//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension CloudWatch {
    // MARK: Enums

    public enum ActionsSuppressedBy: String, CustomStringConvertible, Codable, _SotoSendable {
        case alarm = "Alarm"
        case extensionPeriod = "ExtensionPeriod"
        case waitPeriod = "WaitPeriod"
        public var description: String { return self.rawValue }
    }

    public enum AlarmType: String, CustomStringConvertible, Codable, _SotoSendable {
        case compositeAlarm = "CompositeAlarm"
        case metricAlarm = "MetricAlarm"
        public var description: String { return self.rawValue }
    }

    public enum AnomalyDetectorStateValue: String, CustomStringConvertible, Codable, _SotoSendable {
        case pendingTraining = "PENDING_TRAINING"
        case trained = "TRAINED"
        case trainedInsufficientData = "TRAINED_INSUFFICIENT_DATA"
        public var description: String { return self.rawValue }
    }

    public enum AnomalyDetectorType: String, CustomStringConvertible, Codable, _SotoSendable {
        case metricMath = "METRIC_MATH"
        case singleMetric = "SINGLE_METRIC"
        public var description: String { return self.rawValue }
    }

    public enum ComparisonOperator: String, CustomStringConvertible, Codable, _SotoSendable {
        case greaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold"
        case greaterThanThreshold = "GreaterThanThreshold"
        case greaterThanUpperThreshold = "GreaterThanUpperThreshold"
        case lessThanLowerOrGreaterThanUpperThreshold = "LessThanLowerOrGreaterThanUpperThreshold"
        case lessThanLowerThreshold = "LessThanLowerThreshold"
        case lessThanOrEqualToThreshold = "LessThanOrEqualToThreshold"
        case lessThanThreshold = "LessThanThreshold"
        public var description: String { return self.rawValue }
    }

    public enum EvaluationState: String, CustomStringConvertible, Codable, _SotoSendable {
        case partialData = "PARTIAL_DATA"
        public var description: String { return self.rawValue }
    }

    public enum HistoryItemType: String, CustomStringConvertible, Codable, _SotoSendable {
        case action = "Action"
        case configurationUpdate = "ConfigurationUpdate"
        case stateUpdate = "StateUpdate"
        public var description: String { return self.rawValue }
    }

    public enum MetricStreamOutputFormat: String, CustomStringConvertible, Codable, _SotoSendable {
        case json
        case openTelemetry07 = "opentelemetry0.7"
        public var description: String { return self.rawValue }
    }

    public enum RecentlyActive: String, CustomStringConvertible, Codable, _SotoSendable {
        case pt3h = "PT3H"
        public var description: String { return self.rawValue }
    }

    public enum ScanBy: String, CustomStringConvertible, Codable, _SotoSendable {
        case timestampAscending = "TimestampAscending"
        case timestampDescending = "TimestampDescending"
        public var description: String { return self.rawValue }
    }

    public enum StandardUnit: String, CustomStringConvertible, Codable, _SotoSendable {
        case bits = "Bits"
        case bitsSecond = "Bits/Second"
        case bytes = "Bytes"
        case bytesSecond = "Bytes/Second"
        case count = "Count"
        case countSecond = "Count/Second"
        case gigabits = "Gigabits"
        case gigabitsSecond = "Gigabits/Second"
        case gigabytes = "Gigabytes"
        case gigabytesSecond = "Gigabytes/Second"
        case kilobits = "Kilobits"
        case kilobitsSecond = "Kilobits/Second"
        case kilobytes = "Kilobytes"
        case kilobytesSecond = "Kilobytes/Second"
        case megabits = "Megabits"
        case megabitsSecond = "Megabits/Second"
        case megabytes = "Megabytes"
        case megabytesSecond = "Megabytes/Second"
        case microseconds = "Microseconds"
        case milliseconds = "Milliseconds"
        case none = "None"
        case percent = "Percent"
        case seconds = "Seconds"
        case terabits = "Terabits"
        case terabitsSecond = "Terabits/Second"
        case terabytes = "Terabytes"
        case terabytesSecond = "Terabytes/Second"
        public var description: String { return self.rawValue }
    }

    public enum StateValue: String, CustomStringConvertible, Codable, _SotoSendable {
        case alarm = "ALARM"
        case insufficientData = "INSUFFICIENT_DATA"
        case ok = "OK"
        public var description: String { return self.rawValue }
    }

    public enum Statistic: String, CustomStringConvertible, Codable, _SotoSendable {
        case average = "Average"
        case maximum = "Maximum"
        case minimum = "Minimum"
        case sampleCount = "SampleCount"
        case sum = "Sum"
        public var description: String { return self.rawValue }
    }

    public enum StatusCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case complete = "Complete"
        case forbidden = "Forbidden"
        case internalError = "InternalError"
        case partialData = "PartialData"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AlarmHistoryItem: AWSDecodableShape {
        /// The descriptive name for the alarm.
        public let alarmName: String?
        /// The type of alarm, either metric alarm or composite alarm.
        public let alarmType: AlarmType?
        /// Data about the alarm, in JSON format.
        public let historyData: String?
        /// The type of alarm history item.
        public let historyItemType: HistoryItemType?
        /// A summary of the alarm history, in text format.
        public let historySummary: String?
        /// The time stamp for the alarm history item.
        public let timestamp: Date?

        public init(alarmName: String? = nil, alarmType: AlarmType? = nil, historyData: String? = nil, historyItemType: HistoryItemType? = nil, historySummary: String? = nil, timestamp: Date? = nil) {
            self.alarmName = alarmName
            self.alarmType = alarmType
            self.historyData = historyData
            self.historyItemType = historyItemType
            self.historySummary = historySummary
            self.timestamp = timestamp
        }

        private enum CodingKeys: String, CodingKey {
            case alarmName = "AlarmName"
            case alarmType = "AlarmType"
            case historyData = "HistoryData"
            case historyItemType = "HistoryItemType"
            case historySummary = "HistorySummary"
            case timestamp = "Timestamp"
        }
    }

    public struct AnomalyDetector: AWSDecodableShape {
        /// The configuration specifies details about how the
        /// 		anomaly detection model is to be trained, including time ranges to
        /// 		exclude from use for training the model, and the time zone to use for
        /// 		the metric.
        public let configuration: AnomalyDetectorConfiguration?
        /// The metric dimensions associated with the anomaly detection model.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The CloudWatch metric math expression for this anomaly detector.
        public let metricMathAnomalyDetector: MetricMathAnomalyDetector?
        /// The name of the metric associated with the anomaly detection model.
        public let metricName: String?
        /// The namespace of the metric associated with the anomaly detection model.
        public let namespace: String?
        /// The CloudWatch metric and statistic for this anomaly detector.
        public let singleMetricAnomalyDetector: SingleMetricAnomalyDetector?
        /// The statistic associated with the anomaly detection model.
        public let stat: String?
        /// The current status of the anomaly detector's training. The possible values are TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA
        public let stateValue: AnomalyDetectorStateValue?

        public init(configuration: AnomalyDetectorConfiguration? = nil, metricMathAnomalyDetector: MetricMathAnomalyDetector? = nil, singleMetricAnomalyDetector: SingleMetricAnomalyDetector? = nil, stateValue: AnomalyDetectorStateValue? = nil) {
            self.configuration = configuration
            self.dimensions = nil
            self.metricMathAnomalyDetector = metricMathAnomalyDetector
            self.metricName = nil
            self.namespace = nil
            self.singleMetricAnomalyDetector = singleMetricAnomalyDetector
            self.stat = nil
            self.stateValue = stateValue
        }

        @available(*, deprecated, message: "Members dimensions, metricName, namespace, stat have been deprecated")
        public init(configuration: AnomalyDetectorConfiguration? = nil, dimensions: [Dimension]? = nil, metricMathAnomalyDetector: MetricMathAnomalyDetector? = nil, metricName: String? = nil, namespace: String? = nil, singleMetricAnomalyDetector: SingleMetricAnomalyDetector? = nil, stat: String? = nil, stateValue: AnomalyDetectorStateValue? = nil) {
            self.configuration = configuration
            self.dimensions = dimensions
            self.metricMathAnomalyDetector = metricMathAnomalyDetector
            self.metricName = metricName
            self.namespace = namespace
            self.singleMetricAnomalyDetector = singleMetricAnomalyDetector
            self.stat = stat
            self.stateValue = stateValue
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "Configuration"
            case dimensions = "Dimensions"
            case metricMathAnomalyDetector = "MetricMathAnomalyDetector"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case singleMetricAnomalyDetector = "SingleMetricAnomalyDetector"
            case stat = "Stat"
            case stateValue = "StateValue"
        }
    }

    public struct AnomalyDetectorConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// An array of time ranges to exclude from use when the anomaly detection model is trained. Use
        /// 			this to make sure that events that could cause unusual values for the metric, such as
        /// 			deployments, aren't used when CloudWatch creates the model.
        @OptionalCustomCoding<StandardArrayCoder>
        public var excludedTimeRanges: [Range]?
        /// The time zone to use for the metric. This is useful to enable the model to automatically
        /// 			account for daylight savings time changes if the metric is sensitive to such time
        /// 			changes. To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information,
        /// 			see tz database.
        public let metricTimezone: String?

        public init(excludedTimeRanges: [Range]? = nil, metricTimezone: String? = nil) {
            self.excludedTimeRanges = excludedTimeRanges
            self.metricTimezone = metricTimezone
        }

        public func validate(name: String) throws {
            try self.validate(self.metricTimezone, name: "metricTimezone", parent: name, max: 50)
            try self.validate(self.metricTimezone, name: "metricTimezone", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case excludedTimeRanges = "ExcludedTimeRanges"
            case metricTimezone = "MetricTimezone"
        }
    }

    public struct CompositeAlarm: AWSDecodableShape {
        /// Indicates whether actions should be executed during any changes to the alarm state.
        public let actionsEnabled: Bool?
        /// 			When the value is ALARM,
        /// 			it means
        /// 			that the actions are suppressed
        /// 			because the suppressor alarm is
        /// 			in ALARM
        /// 			When the value is WaitPeriod,
        /// 			it means that
        /// 			the actions are suppressed
        /// 			because the composite alarm is waiting
        /// 			for the suppressor alarm
        /// 			to go
        /// 			into
        /// 			into the ALARM state.
        /// 			The maximum waiting time is as specified
        /// 			in ActionsSuppressorWaitPeriod.
        /// 			After this time,
        /// 			the composite alarm performs its actions.
        /// 			When the value is ExtensionPeriod,
        /// 			it means
        /// 			that the actions are suppressed
        /// 			because the composite alarm is waiting
        /// 			after the suppressor alarm went out
        /// 			of the ALARM state.
        /// 			The maximum waiting time is as specified
        /// 			in ActionsSuppressorExtensionPeriod.
        /// 			After this time,
        /// 			the composite alarm performs its actions.
        ///
        public let actionsSuppressedBy: ActionsSuppressedBy?
        /// 			Captures the reason for action suppression.
        ///
        public let actionsSuppressedReason: String?
        /// 			Actions will be suppressed
        /// 			if the suppressor alarm is
        /// 			in the ALARM state.
        /// 			ActionsSuppressor can be an AlarmName or an Amazon Resource Name (ARN)
        /// 			from an existing alarm.
        ///
        public let actionsSuppressor: String?
        /// 			The maximum time
        /// 			in seconds
        /// 			that the composite alarm waits
        /// 			after suppressor alarm goes out
        /// 			of the ALARM state.
        /// 			After this time,
        /// 			the composite alarm performs its actions.
        /// 		   ExtensionPeriod
        /// 				is required only
        /// 				when ActionsSuppressor is specified.
        ///
        public let actionsSuppressorExtensionPeriod: Int?
        /// 			The maximum time
        /// 			in seconds
        /// 			that the composite alarm waits
        /// 			for the suppressor alarm
        /// 			to go
        /// 			into the ALARM state.
        /// 			After this time,
        /// 			the composite alarm performs its actions.
        /// 		   WaitPeriod
        /// 				is required only
        /// 				when ActionsSuppressor is specified.
        ///
        public let actionsSuppressorWaitPeriod: Int?
        /// The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmActions: [String]?
        /// The Amazon Resource Name (ARN) of the alarm.
        public let alarmArn: String?
        /// The time stamp of the last update to the alarm configuration.
        public let alarmConfigurationUpdatedTimestamp: Date?
        /// The description of the alarm.
        public let alarmDescription: String?
        /// The name of the alarm.
        public let alarmName: String?
        /// The rule that this alarm uses to evaluate its alarm state.
        public let alarmRule: String?
        /// The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
        @OptionalCustomCoding<StandardArrayCoder>
        public var insufficientDataActions: [String]?
        /// The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
        @OptionalCustomCoding<StandardArrayCoder>
        public var okActions: [String]?
        /// An explanation for the alarm state, in text format.
        public let stateReason: String?
        /// An explanation for the alarm state, in JSON format.
        public let stateReasonData: String?
        /// 			The timestamp
        /// 			of the last change
        /// 			to the alarm's StateValue.
        ///
        public let stateTransitionedTimestamp: Date?
        /// Tracks the timestamp of any state update, even if StateValue doesn't change.
        public let stateUpdatedTimestamp: Date?
        /// The state value for the alarm.
        public let stateValue: StateValue?

        public init(actionsEnabled: Bool? = nil, actionsSuppressedBy: ActionsSuppressedBy? = nil, actionsSuppressedReason: String? = nil, actionsSuppressor: String? = nil, actionsSuppressorExtensionPeriod: Int? = nil, actionsSuppressorWaitPeriod: Int? = nil, alarmActions: [String]? = nil, alarmArn: String? = nil, alarmConfigurationUpdatedTimestamp: Date? = nil, alarmDescription: String? = nil, alarmName: String? = nil, alarmRule: String? = nil, insufficientDataActions: [String]? = nil, okActions: [String]? = nil, stateReason: String? = nil, stateReasonData: String? = nil, stateTransitionedTimestamp: Date? = nil, stateUpdatedTimestamp: Date? = nil, stateValue: StateValue? = nil) {
            self.actionsEnabled = actionsEnabled
            self.actionsSuppressedBy = actionsSuppressedBy
            self.actionsSuppressedReason = actionsSuppressedReason
            self.actionsSuppressor = actionsSuppressor
            self.actionsSuppressorExtensionPeriod = actionsSuppressorExtensionPeriod
            self.actionsSuppressorWaitPeriod = actionsSuppressorWaitPeriod
            self.alarmActions = alarmActions
            self.alarmArn = alarmArn
            self.alarmConfigurationUpdatedTimestamp = alarmConfigurationUpdatedTimestamp
            self.alarmDescription = alarmDescription
            self.alarmName = alarmName
            self.alarmRule = alarmRule
            self.insufficientDataActions = insufficientDataActions
            self.okActions = okActions
            self.stateReason = stateReason
            self.stateReasonData = stateReasonData
            self.stateTransitionedTimestamp = stateTransitionedTimestamp
            self.stateUpdatedTimestamp = stateUpdatedTimestamp
            self.stateValue = stateValue
        }

        private enum CodingKeys: String, CodingKey {
            case actionsEnabled = "ActionsEnabled"
            case actionsSuppressedBy = "ActionsSuppressedBy"
            case actionsSuppressedReason = "ActionsSuppressedReason"
            case actionsSuppressor = "ActionsSuppressor"
            case actionsSuppressorExtensionPeriod = "ActionsSuppressorExtensionPeriod"
            case actionsSuppressorWaitPeriod = "ActionsSuppressorWaitPeriod"
            case alarmActions = "AlarmActions"
            case alarmArn = "AlarmArn"
            case alarmConfigurationUpdatedTimestamp = "AlarmConfigurationUpdatedTimestamp"
            case alarmDescription = "AlarmDescription"
            case alarmName = "AlarmName"
            case alarmRule = "AlarmRule"
            case insufficientDataActions = "InsufficientDataActions"
            case okActions = "OKActions"
            case stateReason = "StateReason"
            case stateReasonData = "StateReasonData"
            case stateTransitionedTimestamp = "StateTransitionedTimestamp"
            case stateUpdatedTimestamp = "StateUpdatedTimestamp"
            case stateValue = "StateValue"
        }
    }

    public struct DashboardEntry: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the dashboard.
        public let dashboardArn: String?
        /// The name of the dashboard.
        public let dashboardName: String?
        /// The time stamp of when the dashboard was last modified, either by an API call or
        /// 			through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.
        public let lastModified: Date?
        /// The size of the dashboard, in bytes.
        public let size: Int64?

        public init(dashboardArn: String? = nil, dashboardName: String? = nil, lastModified: Date? = nil, size: Int64? = nil) {
            self.dashboardArn = dashboardArn
            self.dashboardName = dashboardName
            self.lastModified = lastModified
            self.size = size
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardArn = "DashboardArn"
            case dashboardName = "DashboardName"
            case lastModified = "LastModified"
            case size = "Size"
        }
    }

    public struct DashboardValidationMessage: AWSDecodableShape {
        /// The data path related to the message.
        public let dataPath: String?
        /// A message describing the error or warning.
        public let message: String?

        public init(dataPath: String? = nil, message: String? = nil) {
            self.dataPath = dataPath
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case dataPath = "DataPath"
            case message = "Message"
        }
    }

    public struct Datapoint: AWSDecodableShape {
        /// The average of the metric values that correspond to the data point.
        public let average: Double?
        /// The percentile statistic for the data point.
        @OptionalCustomCoding<StandardDictionaryCoder>
        public var extendedStatistics: [String: Double]?
        /// The maximum metric value for the data point.
        public let maximum: Double?
        /// The minimum metric value for the data point.
        public let minimum: Double?
        /// The number of metric values that contributed to the aggregate value of this
        /// 			data point.
        public let sampleCount: Double?
        /// The sum of the metric values for the data point.
        public let sum: Double?
        /// The time stamp used for the data point.
        public let timestamp: Date?
        /// The standard unit for the data point.
        public let unit: StandardUnit?

        public init(average: Double? = nil, extendedStatistics: [String: Double]? = nil, maximum: Double? = nil, minimum: Double? = nil, sampleCount: Double? = nil, sum: Double? = nil, timestamp: Date? = nil, unit: StandardUnit? = nil) {
            self.average = average
            self.extendedStatistics = extendedStatistics
            self.maximum = maximum
            self.minimum = minimum
            self.sampleCount = sampleCount
            self.sum = sum
            self.timestamp = timestamp
            self.unit = unit
        }

        private enum CodingKeys: String, CodingKey {
            case average = "Average"
            case extendedStatistics = "ExtendedStatistics"
            case maximum = "Maximum"
            case minimum = "Minimum"
            case sampleCount = "SampleCount"
            case sum = "Sum"
            case timestamp = "Timestamp"
            case unit = "Unit"
        }
    }

    public struct DeleteAlarmsInput: AWSEncodableShape {
        /// The alarms to be deleted.
        @CustomCoding<StandardArrayCoder>
        public var alarmNames: [String]

        public init(alarmNames: [String]) {
            self.alarmNames = alarmNames
        }

        public func validate(name: String) throws {
            try self.alarmNames.forEach {
                try validate($0, name: "alarmNames[]", parent: name, max: 255)
                try validate($0, name: "alarmNames[]", parent: name, min: 1)
            }
            try self.validate(self.alarmNames, name: "alarmNames", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case alarmNames = "AlarmNames"
        }
    }

    public struct DeleteAnomalyDetectorInput: AWSEncodableShape {
        /// The metric dimensions associated with the anomaly detection model to delete.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The metric math anomaly detector to be deleted. When using MetricMathAnomalyDetector, you cannot include following parameters in the same operation:    Dimensions,    MetricName     Namespace     Stat    the SingleMetricAnomalyDetector parameters of DeleteAnomalyDetectorInput    Instead, specify the metric math anomaly detector attributes as part of the
        /// 			MetricMathAnomalyDetector property.
        public let metricMathAnomalyDetector: MetricMathAnomalyDetector?
        /// The metric name associated with the anomaly detection model to delete.
        public let metricName: String?
        /// The namespace associated with the anomaly detection model to delete.
        public let namespace: String?
        /// A single metric anomaly detector to be deleted. When using SingleMetricAnomalyDetector,
        /// 			you cannot include the following parameters in the same operation:    Dimensions,    MetricName     Namespace     Stat    the MetricMathAnomalyDetector parameters of DeleteAnomalyDetectorInput    Instead, specify the single metric anomaly detector attributes
        /// 			as part of the SingleMetricAnomalyDetector property.
        public let singleMetricAnomalyDetector: SingleMetricAnomalyDetector?
        /// The statistic associated with the anomaly detection model to delete.
        public let stat: String?

        public init(metricMathAnomalyDetector: MetricMathAnomalyDetector? = nil, singleMetricAnomalyDetector: SingleMetricAnomalyDetector? = nil) {
            self.dimensions = nil
            self.metricMathAnomalyDetector = metricMathAnomalyDetector
            self.metricName = nil
            self.namespace = nil
            self.singleMetricAnomalyDetector = singleMetricAnomalyDetector
            self.stat = nil
        }

        @available(*, deprecated, message: "Members dimensions, metricName, namespace, stat have been deprecated")
        public init(dimensions: [Dimension]? = nil, metricMathAnomalyDetector: MetricMathAnomalyDetector? = nil, metricName: String? = nil, namespace: String? = nil, singleMetricAnomalyDetector: SingleMetricAnomalyDetector? = nil, stat: String? = nil) {
            self.dimensions = dimensions
            self.metricMathAnomalyDetector = metricMathAnomalyDetector
            self.metricName = metricName
            self.namespace = namespace
            self.singleMetricAnomalyDetector = singleMetricAnomalyDetector
            self.stat = stat
        }

        public func validate(name: String) throws {
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.metricMathAnomalyDetector?.validate(name: "\(name).metricMathAnomalyDetector")
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
            try self.singleMetricAnomalyDetector?.validate(name: "\(name).singleMetricAnomalyDetector")
            try self.validate(self.stat, name: "stat", parent: name, max: 50)
            try self.validate(self.stat, name: "stat", parent: name, pattern: "^(SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm)(\\d{1,2}(\\.\\d{0,10})?|100)|[ou]\\d+(\\.\\d*)?)(_E|_L|_H)?|(TM|TC|TS|WM)\\(((((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%)?:((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%|((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%:(((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%)?)\\)|(TM|TC|TS|WM|PR)\\(((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)):((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))?|((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))?:(\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))\\)$")
        }

        private enum CodingKeys: String, CodingKey {
            case dimensions = "Dimensions"
            case metricMathAnomalyDetector = "MetricMathAnomalyDetector"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case singleMetricAnomalyDetector = "SingleMetricAnomalyDetector"
            case stat = "Stat"
        }
    }

    public struct DeleteAnomalyDetectorOutput: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteDashboardsInput: AWSEncodableShape {
        /// The dashboards to be deleted. This parameter is required.
        @CustomCoding<StandardArrayCoder>
        public var dashboardNames: [String]

        public init(dashboardNames: [String]) {
            self.dashboardNames = dashboardNames
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardNames = "DashboardNames"
        }
    }

    public struct DeleteDashboardsOutput: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteInsightRulesInput: AWSEncodableShape {
        /// An array of the rule names to delete. If you need to find out the names of your rules, use DescribeInsightRules.
        @CustomCoding<StandardArrayCoder>
        public var ruleNames: [String]

        public init(ruleNames: [String]) {
            self.ruleNames = ruleNames
        }

        public func validate(name: String) throws {
            try self.ruleNames.forEach {
                try validate($0, name: "ruleNames[]", parent: name, max: 128)
                try validate($0, name: "ruleNames[]", parent: name, min: 1)
                try validate($0, name: "ruleNames[]", parent: name, pattern: "^[\\x20-\\x7E]+$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case ruleNames = "RuleNames"
        }
    }

    public struct DeleteInsightRulesOutput: AWSDecodableShape {
        /// An array listing the rules that could not be deleted. You cannot delete built-in rules.
        @OptionalCustomCoding<StandardArrayCoder>
        public var failures: [PartialFailure]?

        public init(failures: [PartialFailure]? = nil) {
            self.failures = failures
        }

        private enum CodingKeys: String, CodingKey {
            case failures = "Failures"
        }
    }

    public struct DeleteMetricStreamInput: AWSEncodableShape {
        /// The name of the metric stream to delete.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteMetricStreamOutput: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeAlarmHistoryInput: AWSEncodableShape {
        /// The name of the alarm.
        public let alarmName: String?
        /// Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter,
        /// 			only metric alarms are returned.
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmTypes: [AlarmType]?
        /// The ending date to retrieve alarm history.
        public let endDate: Date?
        /// The type of alarm histories to retrieve.
        public let historyItemType: HistoryItemType?
        /// The maximum number of alarm history records to retrieve.
        public let maxRecords: Int?
        /// The token returned by a previous call to indicate that there is more data
        /// 			available.
        public let nextToken: String?
        /// Specified whether to return the newest or oldest alarm history first. Specify TimestampDescending to have the newest
        /// 		event history returned first, and specify TimestampAscending to have the oldest history returned first.
        public let scanBy: ScanBy?
        /// The starting date to retrieve alarm history.
        public let startDate: Date?

        public init(alarmName: String? = nil, alarmTypes: [AlarmType]? = nil, endDate: Date? = nil, historyItemType: HistoryItemType? = nil, maxRecords: Int? = nil, nextToken: String? = nil, scanBy: ScanBy? = nil, startDate: Date? = nil) {
            self.alarmName = alarmName
            self.alarmTypes = alarmTypes
            self.endDate = endDate
            self.historyItemType = historyItemType
            self.maxRecords = maxRecords
            self.nextToken = nextToken
            self.scanBy = scanBy
            self.startDate = startDate
        }

        public func validate(name: String) throws {
            try self.validate(self.alarmName, name: "alarmName", parent: name, max: 255)
            try self.validate(self.alarmName, name: "alarmName", parent: name, min: 1)
            try self.validate(self.maxRecords, name: "maxRecords", parent: name, max: 100)
            try self.validate(self.maxRecords, name: "maxRecords", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case alarmName = "AlarmName"
            case alarmTypes = "AlarmTypes"
            case endDate = "EndDate"
            case historyItemType = "HistoryItemType"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
            case scanBy = "ScanBy"
            case startDate = "StartDate"
        }
    }

    public struct DescribeAlarmHistoryOutput: AWSDecodableShape {
        /// The alarm histories, in JSON format.
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmHistoryItems: [AlarmHistoryItem]?
        /// The token that marks the start of the next batch of returned results.
        public let nextToken: String?

        public init(alarmHistoryItems: [AlarmHistoryItem]? = nil, nextToken: String? = nil) {
            self.alarmHistoryItems = alarmHistoryItems
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case alarmHistoryItems = "AlarmHistoryItems"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeAlarmsForMetricInput: AWSEncodableShape {
        /// The dimensions associated with the metric. If the metric has any associated
        /// 			dimensions, you must specify them in order for the call to succeed.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The percentile statistic for the metric. Specify a value between
        /// 		    p0.0 and p100.
        public let extendedStatistic: String?
        /// The name of the metric.
        public let metricName: String
        /// The namespace of the metric.
        public let namespace: String
        /// The period, in seconds, over which the statistic is applied.
        public let period: Int?
        /// The statistic for the metric, other than percentiles.
        /// 		    For percentile statistics, use ExtendedStatistics.
        public let statistic: Statistic?
        /// The unit for the metric.
        public let unit: StandardUnit?

        public init(dimensions: [Dimension]? = nil, extendedStatistic: String? = nil, metricName: String, namespace: String, period: Int? = nil, statistic: Statistic? = nil, unit: StandardUnit? = nil) {
            self.dimensions = dimensions
            self.extendedStatistic = extendedStatistic
            self.metricName = metricName
            self.namespace = namespace
            self.period = period
            self.statistic = statistic
            self.unit = unit
        }

        public func validate(name: String) throws {
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
            try self.validate(self.period, name: "period", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case dimensions = "Dimensions"
            case extendedStatistic = "ExtendedStatistic"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case period = "Period"
            case statistic = "Statistic"
            case unit = "Unit"
        }
    }

    public struct DescribeAlarmsForMetricOutput: AWSDecodableShape {
        /// The information for each alarm with the specified metric.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metricAlarms: [MetricAlarm]?

        public init(metricAlarms: [MetricAlarm]? = nil) {
            self.metricAlarms = metricAlarms
        }

        private enum CodingKeys: String, CodingKey {
            case metricAlarms = "MetricAlarms"
        }
    }

    public struct DescribeAlarmsInput: AWSEncodableShape {
        /// Use this parameter to filter the results of the operation to only those alarms that
        /// 		use a certain alarm action. For example, you could specify the ARN of an SNS topic to find all
        /// 		alarms that send notifications to that topic.
        public let actionPrefix: String?
        /// An alarm name prefix. If you specify this parameter, you receive information about all alarms that have names
        /// 			that start with this prefix. If this parameter
        /// 			is specified, you cannot specify AlarmNames.
        public let alarmNamePrefix: String?
        /// The names of the alarms to retrieve information about.
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmNames: [String]?
        /// Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter,
        /// 		only metric alarms are returned.
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmTypes: [AlarmType]?
        /// If you use this parameter and specify the name of a composite alarm, the operation returns
        /// 			information about the "children" alarms
        /// 			of the alarm you specify. These are the metric alarms and composite alarms referenced in the
        /// 			AlarmRule field of the composite alarm that you specify in
        /// 			ChildrenOfAlarmName. Information about the composite alarm that you name in
        /// 			ChildrenOfAlarmName is not returned. If you specify ChildrenOfAlarmName, you cannot specify any other parameters in the request except
        /// 			for MaxRecords and NextToken. If you do so, you
        /// 			receive a validation
        /// 			error.  Only the Alarm Name, ARN, StateValue (OK/ALARM/INSUFFICIENT_DATA), and StateUpdatedTimestamp
        /// 			information are returned by this operation
        /// 			when you use this parameter. To get complete information about
        /// 			these alarms, perform another DescribeAlarms operation and specify
        /// 			the parent alarm names in the AlarmNames parameter.
        public let childrenOfAlarmName: String?
        /// The maximum number of alarm descriptions to retrieve.
        public let maxRecords: Int?
        /// The token returned by a previous call to indicate that there is more data
        /// 			available.
        public let nextToken: String?
        /// If you use this parameter and specify the name of a metric or composite alarm, the operation returns
        /// 			information about the "parent" alarms
        /// 			of the alarm you specify. These are the composite alarms that have AlarmRule
        /// 			parameters that reference
        /// 			the alarm named in ParentsOfAlarmName. Information about the alarm that you specify in
        /// 			ParentsOfAlarmName is not returned. If you specify ParentsOfAlarmName, you cannot specify any other parameters in the request except
        /// 			for MaxRecords and NextToken. If you do so, you receive a validation
        /// 			error.  Only the Alarm Name and ARN are returned by this operation when you use this parameter. To get complete information about
        /// 			these alarms, perform another DescribeAlarms operation and specify
        /// 			the parent alarm names in the AlarmNames parameter.
        public let parentsOfAlarmName: String?
        /// Specify this parameter to receive information only about alarms that are currently in the state that you specify.
        public let stateValue: StateValue?

        public init(actionPrefix: String? = nil, alarmNamePrefix: String? = nil, alarmNames: [String]? = nil, alarmTypes: [AlarmType]? = nil, childrenOfAlarmName: String? = nil, maxRecords: Int? = nil, nextToken: String? = nil, parentsOfAlarmName: String? = nil, stateValue: StateValue? = nil) {
            self.actionPrefix = actionPrefix
            self.alarmNamePrefix = alarmNamePrefix
            self.alarmNames = alarmNames
            self.alarmTypes = alarmTypes
            self.childrenOfAlarmName = childrenOfAlarmName
            self.maxRecords = maxRecords
            self.nextToken = nextToken
            self.parentsOfAlarmName = parentsOfAlarmName
            self.stateValue = stateValue
        }

        public func validate(name: String) throws {
            try self.validate(self.actionPrefix, name: "actionPrefix", parent: name, max: 1024)
            try self.validate(self.actionPrefix, name: "actionPrefix", parent: name, min: 1)
            try self.validate(self.alarmNamePrefix, name: "alarmNamePrefix", parent: name, max: 255)
            try self.validate(self.alarmNamePrefix, name: "alarmNamePrefix", parent: name, min: 1)
            try self.alarmNames?.forEach {
                try validate($0, name: "alarmNames[]", parent: name, max: 255)
                try validate($0, name: "alarmNames[]", parent: name, min: 1)
            }
            try self.validate(self.alarmNames, name: "alarmNames", parent: name, max: 100)
            try self.validate(self.childrenOfAlarmName, name: "childrenOfAlarmName", parent: name, max: 255)
            try self.validate(self.childrenOfAlarmName, name: "childrenOfAlarmName", parent: name, min: 1)
            try self.validate(self.maxRecords, name: "maxRecords", parent: name, max: 100)
            try self.validate(self.maxRecords, name: "maxRecords", parent: name, min: 1)
            try self.validate(self.parentsOfAlarmName, name: "parentsOfAlarmName", parent: name, max: 255)
            try self.validate(self.parentsOfAlarmName, name: "parentsOfAlarmName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case actionPrefix = "ActionPrefix"
            case alarmNamePrefix = "AlarmNamePrefix"
            case alarmNames = "AlarmNames"
            case alarmTypes = "AlarmTypes"
            case childrenOfAlarmName = "ChildrenOfAlarmName"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
            case parentsOfAlarmName = "ParentsOfAlarmName"
            case stateValue = "StateValue"
        }
    }

    public struct DescribeAlarmsOutput: AWSDecodableShape {
        /// The information about any composite alarms returned by the operation.
        @OptionalCustomCoding<StandardArrayCoder>
        public var compositeAlarms: [CompositeAlarm]?
        /// The information about any metric alarms returned by the operation.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metricAlarms: [MetricAlarm]?
        /// The token that marks the start of the next batch of returned results.
        public let nextToken: String?

        public init(compositeAlarms: [CompositeAlarm]? = nil, metricAlarms: [MetricAlarm]? = nil, nextToken: String? = nil) {
            self.compositeAlarms = compositeAlarms
            self.metricAlarms = metricAlarms
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case compositeAlarms = "CompositeAlarms"
            case metricAlarms = "MetricAlarms"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeAnomalyDetectorsInput: AWSEncodableShape {
        /// The anomaly detector types to request when using DescribeAnomalyDetectorsInput.
        /// 			If empty, defaults to SINGLE_METRIC.
        @OptionalCustomCoding<StandardArrayCoder>
        public var anomalyDetectorTypes: [AnomalyDetectorType]?
        /// Limits the results to only the anomaly detection models that are associated with the
        /// 			specified metric dimensions. If there are multiple metrics that have these dimensions
        /// 			and have anomaly detection models associated, they're all returned.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The maximum number of results to return in one operation. The maximum
        /// 			value that you can specify is 100. To retrieve the remaining results, make another call with the returned
        /// 			NextToken value.
        public let maxResults: Int?
        /// Limits the results to only the anomaly detection models that are associated with the
        /// 			specified metric name. If there are multiple metrics with this name in different
        /// 			namespaces that have anomaly detection models, they're all returned.
        public let metricName: String?
        /// Limits the results to only the anomaly detection models that
        /// 			are associated with the specified namespace.
        public let namespace: String?
        /// Use the token returned by the previous operation to request the next page of results.
        public let nextToken: String?

        public init(anomalyDetectorTypes: [AnomalyDetectorType]? = nil, dimensions: [Dimension]? = nil, maxResults: Int? = nil, metricName: String? = nil, namespace: String? = nil, nextToken: String? = nil) {
            self.anomalyDetectorTypes = anomalyDetectorTypes
            self.dimensions = dimensions
            self.maxResults = maxResults
            self.metricName = metricName
            self.namespace = namespace
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.anomalyDetectorTypes, name: "anomalyDetectorTypes", parent: name, max: 2)
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
        }

        private enum CodingKeys: String, CodingKey {
            case anomalyDetectorTypes = "AnomalyDetectorTypes"
            case dimensions = "Dimensions"
            case maxResults = "MaxResults"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeAnomalyDetectorsOutput: AWSDecodableShape {
        /// The list of anomaly detection models returned by the operation.
        @OptionalCustomCoding<StandardArrayCoder>
        public var anomalyDetectors: [AnomalyDetector]?
        /// A token that you can use in a subsequent operation to
        /// 		retrieve the next set of results.
        public let nextToken: String?

        public init(anomalyDetectors: [AnomalyDetector]? = nil, nextToken: String? = nil) {
            self.anomalyDetectors = anomalyDetectors
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case anomalyDetectors = "AnomalyDetectors"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeInsightRulesInput: AWSEncodableShape {
        /// The maximum number of results to return in one operation. If you omit this
        /// 		parameter, the default of 500 is used.
        public let maxResults: Int?
        /// Include this value, if it was returned by the previous operation, to get the next set of rules.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 500)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeInsightRulesOutput: AWSDecodableShape {
        /// The rules returned by the operation.
        @OptionalCustomCoding<StandardArrayCoder>
        public var insightRules: [InsightRule]?
        /// If this parameter is present, it is a token that marks the start of the next batch of returned results.
        public let nextToken: String?

        public init(insightRules: [InsightRule]? = nil, nextToken: String? = nil) {
            self.insightRules = insightRules
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case insightRules = "InsightRules"
            case nextToken = "NextToken"
        }
    }

    public struct Dimension: AWSEncodableShape & AWSDecodableShape {
        /// The name of the dimension. Dimension names must contain only ASCII characters, must include
        /// 			at least one non-whitespace character, and cannot start with a colon (:).
        public let name: String
        /// The value of the dimension. Dimension values must contain only ASCII characters and must include
        /// 			at least one non-whitespace character.
        public let value: String

        public init(name: String, value: String) {
            self.name = name
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 1024)
            try self.validate(self.value, name: "value", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case value = "Value"
        }
    }

    public struct DimensionFilter: AWSEncodableShape {
        /// The dimension name to be matched.
        public let name: String
        /// The value of the dimension to be matched.
        public let value: String?

        public init(name: String, value: String? = nil) {
            self.name = name
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 1024)
            try self.validate(self.value, name: "value", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case value = "Value"
        }
    }

    public struct DisableAlarmActionsInput: AWSEncodableShape {
        /// The names of the alarms.
        @CustomCoding<StandardArrayCoder>
        public var alarmNames: [String]

        public init(alarmNames: [String]) {
            self.alarmNames = alarmNames
        }

        public func validate(name: String) throws {
            try self.alarmNames.forEach {
                try validate($0, name: "alarmNames[]", parent: name, max: 255)
                try validate($0, name: "alarmNames[]", parent: name, min: 1)
            }
            try self.validate(self.alarmNames, name: "alarmNames", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case alarmNames = "AlarmNames"
        }
    }

    public struct DisableInsightRulesInput: AWSEncodableShape {
        /// An array of the rule names to disable. If you need to find out the names of your rules, use DescribeInsightRules.
        @CustomCoding<StandardArrayCoder>
        public var ruleNames: [String]

        public init(ruleNames: [String]) {
            self.ruleNames = ruleNames
        }

        public func validate(name: String) throws {
            try self.ruleNames.forEach {
                try validate($0, name: "ruleNames[]", parent: name, max: 128)
                try validate($0, name: "ruleNames[]", parent: name, min: 1)
                try validate($0, name: "ruleNames[]", parent: name, pattern: "^[\\x20-\\x7E]+$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case ruleNames = "RuleNames"
        }
    }

    public struct DisableInsightRulesOutput: AWSDecodableShape {
        /// An array listing the rules that could not be disabled. You cannot disable built-in rules.
        @OptionalCustomCoding<StandardArrayCoder>
        public var failures: [PartialFailure]?

        public init(failures: [PartialFailure]? = nil) {
            self.failures = failures
        }

        private enum CodingKeys: String, CodingKey {
            case failures = "Failures"
        }
    }

    public struct EnableAlarmActionsInput: AWSEncodableShape {
        /// The names of the alarms.
        @CustomCoding<StandardArrayCoder>
        public var alarmNames: [String]

        public init(alarmNames: [String]) {
            self.alarmNames = alarmNames
        }

        public func validate(name: String) throws {
            try self.alarmNames.forEach {
                try validate($0, name: "alarmNames[]", parent: name, max: 255)
                try validate($0, name: "alarmNames[]", parent: name, min: 1)
            }
            try self.validate(self.alarmNames, name: "alarmNames", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case alarmNames = "AlarmNames"
        }
    }

    public struct EnableInsightRulesInput: AWSEncodableShape {
        /// An array of the rule names to enable. If you need to find out the names of your rules, use DescribeInsightRules.
        @CustomCoding<StandardArrayCoder>
        public var ruleNames: [String]

        public init(ruleNames: [String]) {
            self.ruleNames = ruleNames
        }

        public func validate(name: String) throws {
            try self.ruleNames.forEach {
                try validate($0, name: "ruleNames[]", parent: name, max: 128)
                try validate($0, name: "ruleNames[]", parent: name, min: 1)
                try validate($0, name: "ruleNames[]", parent: name, pattern: "^[\\x20-\\x7E]+$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case ruleNames = "RuleNames"
        }
    }

    public struct EnableInsightRulesOutput: AWSDecodableShape {
        /// An array listing the rules that could not be enabled. You cannot disable or enable built-in rules.
        @OptionalCustomCoding<StandardArrayCoder>
        public var failures: [PartialFailure]?

        public init(failures: [PartialFailure]? = nil) {
            self.failures = failures
        }

        private enum CodingKeys: String, CodingKey {
            case failures = "Failures"
        }
    }

    public struct GetDashboardInput: AWSEncodableShape {
        /// The name of the dashboard to be described.
        public let dashboardName: String

        public init(dashboardName: String) {
            self.dashboardName = dashboardName
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardName = "DashboardName"
        }
    }

    public struct GetDashboardOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the dashboard.
        public let dashboardArn: String?
        /// The detailed information about the dashboard, including what widgets are included and their location
        /// 			on the dashboard. For more information about the DashboardBody syntax,
        /// 			see Dashboard Body Structure and Syntax.
        public let dashboardBody: String?
        /// The name of the dashboard.
        public let dashboardName: String?

        public init(dashboardArn: String? = nil, dashboardBody: String? = nil, dashboardName: String? = nil) {
            self.dashboardArn = dashboardArn
            self.dashboardBody = dashboardBody
            self.dashboardName = dashboardName
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardArn = "DashboardArn"
            case dashboardBody = "DashboardBody"
            case dashboardName = "DashboardName"
        }
    }

    public struct GetInsightRuleReportInput: AWSEncodableShape {
        /// The end time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as
        /// 			yyyy-MM-dd'T'HH:mm:ss. For example,
        /// 			2019-07-01T23:59:59.
        public let endTime: Date
        /// The maximum number of contributors to include in the report. The range is 1 to 100. If you omit this, the default of 10 is used.
        public let maxContributorCount: Int?
        /// Specifies which metrics to use for aggregation of contributor values for the report. You can specify one or more
        /// 		of the following metrics:    UniqueContributors -- the number of unique contributors for each data point.    MaxContributorValue -- the value of the top contributor for each data point. The identity of the
        /// 					contributor might change for each data point in the graph. If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the
        /// 					most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified
        /// 					by the rule's Value, during that period.    SampleCount -- the number of data points matched by the rule.    Sum -- the sum of the values from all contributors during the time period represented by that data point.    Minimum -- the minimum value from a single observation during the time period represented by that data point.    Maximum -- the maximum value from a single observation during the time period represented by that data point.    Average -- the average value from all contributors during the time period represented by that data point.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metrics: [String]?
        /// Determines what statistic to use to rank the contributors. Valid values are SUM and MAXIMUM.
        public let orderBy: String?
        /// The period, in seconds, to use for the statistics in the InsightRuleMetricDatapoint results.
        public let period: Int
        /// The name of the rule that you want to see data from.
        public let ruleName: String
        /// The start time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as
        /// 			yyyy-MM-dd'T'HH:mm:ss. For example,
        /// 			2019-07-01T23:59:59.
        public let startTime: Date

        public init(endTime: Date, maxContributorCount: Int? = nil, metrics: [String]? = nil, orderBy: String? = nil, period: Int, ruleName: String, startTime: Date) {
            self.endTime = endTime
            self.maxContributorCount = maxContributorCount
            self.metrics = metrics
            self.orderBy = orderBy
            self.period = period
            self.ruleName = ruleName
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.metrics?.forEach {
                try validate($0, name: "metrics[]", parent: name, max: 32)
                try validate($0, name: "metrics[]", parent: name, min: 1)
                try validate($0, name: "metrics[]", parent: name, pattern: "^[\\x20-\\x7E]+$")
            }
            try self.validate(self.orderBy, name: "orderBy", parent: name, max: 32)
            try self.validate(self.orderBy, name: "orderBy", parent: name, min: 1)
            try self.validate(self.orderBy, name: "orderBy", parent: name, pattern: "^[\\x20-\\x7E]+$")
            try self.validate(self.period, name: "period", parent: name, min: 1)
            try self.validate(self.ruleName, name: "ruleName", parent: name, max: 128)
            try self.validate(self.ruleName, name: "ruleName", parent: name, min: 1)
            try self.validate(self.ruleName, name: "ruleName", parent: name, pattern: "^[\\x20-\\x7E]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case maxContributorCount = "MaxContributorCount"
            case metrics = "Metrics"
            case orderBy = "OrderBy"
            case period = "Period"
            case ruleName = "RuleName"
            case startTime = "StartTime"
        }
    }

    public struct GetInsightRuleReportOutput: AWSDecodableShape {
        /// The sum of the values from all individual contributors that match the rule.
        public let aggregateValue: Double?
        /// Specifies whether this rule aggregates contributor data by COUNT or SUM.
        public let aggregationStatistic: String?
        /// An approximate count of the unique contributors found by this rule in this time period.
        public let approximateUniqueCount: Int64?
        /// An array of the unique contributors found by this rule in this time period. If the rule contains multiple keys, each combination of values
        /// 		for the keys counts as a unique contributor.
        @OptionalCustomCoding<StandardArrayCoder>
        public var contributors: [InsightRuleContributor]?
        /// An array of the strings used as the keys for this rule. The keys are the dimensions used to classify contributors.
        /// 			If the rule contains more than one key, then each unique combination of values for the keys is counted as a unique contributor.
        @OptionalCustomCoding<StandardArrayCoder>
        public var keyLabels: [String]?
        /// A time series of metric data points that matches the time period in the rule request.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metricDatapoints: [InsightRuleMetricDatapoint]?

        public init(aggregateValue: Double? = nil, aggregationStatistic: String? = nil, approximateUniqueCount: Int64? = nil, contributors: [InsightRuleContributor]? = nil, keyLabels: [String]? = nil, metricDatapoints: [InsightRuleMetricDatapoint]? = nil) {
            self.aggregateValue = aggregateValue
            self.aggregationStatistic = aggregationStatistic
            self.approximateUniqueCount = approximateUniqueCount
            self.contributors = contributors
            self.keyLabels = keyLabels
            self.metricDatapoints = metricDatapoints
        }

        private enum CodingKeys: String, CodingKey {
            case aggregateValue = "AggregateValue"
            case aggregationStatistic = "AggregationStatistic"
            case approximateUniqueCount = "ApproximateUniqueCount"
            case contributors = "Contributors"
            case keyLabels = "KeyLabels"
            case metricDatapoints = "MetricDatapoints"
        }
    }

    public struct GetMetricDataInput: AWSEncodableShape {
        /// The time stamp indicating the latest data to be returned. The value specified is exclusive; results include data points up to the specified time stamp. For better performance, specify StartTime and EndTime
        /// 			values that align with the value of the metric's Period and sync up with
        /// 			the beginning and end of an hour. For example, if the Period of a metric
        /// 			is 5 minutes, specifying 12:05 or 12:30 as EndTime can get a faster response
        /// 			from CloudWatch than setting 12:07 or 12:29 as the EndTime.
        public let endTime: Date
        /// This structure includes the Timezone parameter, which you can use
        /// 			to specify your time zone so that the labels of returned data display the
        /// 			correct time
        /// 			for your time zone.
        public let labelOptions: LabelOptions?
        /// The maximum number of data points the request should return before paginating. If you omit
        /// 			this, the default of 100,800 is used.
        public let maxDatapoints: Int?
        /// The metric queries to be returned. A single GetMetricData call can
        /// 			include as many as 500 MetricDataQuery
        /// 		structures. Each of these structures can specify either a metric to retrieve, a Metrics Insights query,
        /// 		or a math expression to perform on retrieved data.
        @CustomCoding<StandardArrayCoder>
        public var metricDataQueries: [MetricDataQuery]
        /// Include this value, if it was returned by the previous GetMetricData operation,
        /// 			to get the next set of data points.
        public let nextToken: String?
        /// The order in which data points should be returned. TimestampDescending returns the newest data first and paginates
        /// 			when the MaxDatapoints limit is reached. TimestampAscending returns the oldest data first and paginates
        /// 			when the MaxDatapoints limit is reached.
        public let scanBy: ScanBy?
        /// The time stamp indicating the earliest data to be returned. The value specified is inclusive; results include data points with the specified time stamp.  CloudWatch rounds the specified time stamp as follows:   Start time less than 15 days ago - Round down to the nearest whole minute.
        /// 				For example, 12:32:34 is rounded down to 12:32:00.   Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval.
        /// 				For example, 12:32:34 is rounded down to 12:30:00.   Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval.
        /// 				For example, 12:32:34 is rounded down to 12:00:00.   If you set Period to 5, 10, or 30, the start time of your request is
        /// 			rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions
        /// 			of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous
        /// 			10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to
        /// 			01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a
        /// 			period of 5 seconds, you receive data
        /// 			timestamped between 15:02:15 and 15:07:15.
        /// 		 For better performance, specify StartTime and EndTime
        /// 		values that align with the value of the metric's Period and sync up with
        /// 		the beginning and end of an hour. For example, if the Period of a metric
        /// 		is 5 minutes, specifying 12:05 or 12:30 as StartTime can get a faster response
        /// 			from CloudWatch than setting 12:07 or 12:29 as the StartTime.
        public let startTime: Date

        public init(endTime: Date, labelOptions: LabelOptions? = nil, maxDatapoints: Int? = nil, metricDataQueries: [MetricDataQuery], nextToken: String? = nil, scanBy: ScanBy? = nil, startTime: Date) {
            self.endTime = endTime
            self.labelOptions = labelOptions
            self.maxDatapoints = maxDatapoints
            self.metricDataQueries = metricDataQueries
            self.nextToken = nextToken
            self.scanBy = scanBy
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.metricDataQueries.forEach {
                try $0.validate(name: "\(name).metricDataQueries[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case labelOptions = "LabelOptions"
            case maxDatapoints = "MaxDatapoints"
            case metricDataQueries = "MetricDataQueries"
            case nextToken = "NextToken"
            case scanBy = "ScanBy"
            case startTime = "StartTime"
        }
    }

    public struct GetMetricDataOutput: AWSDecodableShape {
        /// Contains a message about this GetMetricData operation, if the operation results in such a message.
        /// 			An example of a message that
        /// 			might be returned is Maximum number of allowed metrics exceeded. If there is a message, as much of the
        /// 			operation as possible is still executed. A message appears here only if it is related to the global GetMetricData operation. Any message
        /// 			about a specific metric returned by the operation appears in the MetricDataResult object returned for that metric.
        @OptionalCustomCoding<StandardArrayCoder>
        public var messages: [MessageData]?
        /// The metrics that are returned, including the metric name, namespace, and dimensions.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metricDataResults: [MetricDataResult]?
        /// A token that marks the next batch of returned results.
        public let nextToken: String?

        public init(messages: [MessageData]? = nil, metricDataResults: [MetricDataResult]? = nil, nextToken: String? = nil) {
            self.messages = messages
            self.metricDataResults = metricDataResults
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case messages = "Messages"
            case metricDataResults = "MetricDataResults"
            case nextToken = "NextToken"
        }
    }

    public struct GetMetricStatisticsInput: AWSEncodableShape {
        /// The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension.
        /// 			CloudWatch treats each unique combination of dimensions as a separate metric.
        /// 		    If a specific combination of dimensions was not published, you can't retrieve statistics for it.
        /// 		    You must specify the same dimensions that were used when the metrics were created. For an example,
        /// 		    see Dimension Combinations in the Amazon CloudWatch User Guide. For more information about specifying dimensions, see Publishing Metrics in the
        /// 			Amazon CloudWatch User Guide.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The time stamp that determines the last data point to return. The value specified is exclusive; results include data points up to the specified time stamp.
        /// 			In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
        public let endTime: Date
        /// The percentile statistics. Specify values between p0.0 and p100. When calling GetMetricStatistics, you must
        /// 			specify either Statistics or ExtendedStatistics, but not both. Percentile statistics are not
        /// 			available for metrics when any of the metric values are negative numbers.
        @OptionalCustomCoding<StandardArrayCoder>
        public var extendedStatistics: [String]?
        /// The name of the metric, with or without spaces.
        public let metricName: String
        /// The namespace of the metric, with or without spaces.
        public let namespace: String
        /// The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can
        /// 			be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected
        /// 			at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics
        /// 		are those metrics stored by a PutMetricData call that includes a StorageResolution of 1 second. If the StartTime parameter specifies a time stamp that is greater than
        /// 		    3 hours ago, you must specify the period as follows or no data points in that time range is returned:   Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).   Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).   Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
        public let period: Int
        /// The time stamp that determines the first data point to return. Start times are
        /// 			evaluated relative to the time that CloudWatch receives the request. The value specified is inclusive; results include data points with the specified time stamp.
        /// 	    	In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z). CloudWatch rounds the specified time stamp as follows:   Start time less than 15 days ago - Round down to the nearest whole minute.
        /// 			    For example, 12:32:34 is rounded down to 12:32:00.   Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval.
        /// 			    For example, 12:32:34 is rounded down to 12:30:00.   Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval.
        /// 			    For example, 12:32:34 is rounded down to 12:00:00.   If you set Period to 5, 10, or 30, the start time of your request is
        /// 			rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions
        /// 			of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous
        /// 			10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to
        /// 			01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a
        /// 			period of 5 seconds, you receive data
        /// 			timestamped between 15:02:15 and 15:07:15.
        ///
        public let startTime: Date
        /// The metric statistics, other than percentile. For percentile statistics,
        /// 		    use ExtendedStatistics. When calling GetMetricStatistics, you must
        /// 		specify either Statistics or ExtendedStatistics, but not both.
        @OptionalCustomCoding<StandardArrayCoder>
        public var statistics: [Statistic]?
        /// The unit for a given metric.
        /// 			If you omit Unit, all data that was collected with any unit is returned, along with the corresponding units that were specified
        /// 			when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified.
        /// 			If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.
        public let unit: StandardUnit?

        public init(dimensions: [Dimension]? = nil, endTime: Date, extendedStatistics: [String]? = nil, metricName: String, namespace: String, period: Int, startTime: Date, statistics: [Statistic]? = nil, unit: StandardUnit? = nil) {
            self.dimensions = dimensions
            self.endTime = endTime
            self.extendedStatistics = extendedStatistics
            self.metricName = metricName
            self.namespace = namespace
            self.period = period
            self.startTime = startTime
            self.statistics = statistics
            self.unit = unit
        }

        public func validate(name: String) throws {
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.validate(self.extendedStatistics, name: "extendedStatistics", parent: name, max: 10)
            try self.validate(self.extendedStatistics, name: "extendedStatistics", parent: name, min: 1)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
            try self.validate(self.period, name: "period", parent: name, min: 1)
            try self.validate(self.statistics, name: "statistics", parent: name, max: 5)
            try self.validate(self.statistics, name: "statistics", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case dimensions = "Dimensions"
            case endTime = "EndTime"
            case extendedStatistics = "ExtendedStatistics"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case period = "Period"
            case startTime = "StartTime"
            case statistics = "Statistics"
            case unit = "Unit"
        }
    }

    public struct GetMetricStatisticsOutput: AWSDecodableShape {
        /// The data points for the specified metric.
        @OptionalCustomCoding<StandardArrayCoder>
        public var datapoints: [Datapoint]?
        /// A label for the specified metric.
        public let label: String?

        public init(datapoints: [Datapoint]? = nil, label: String? = nil) {
            self.datapoints = datapoints
            self.label = label
        }

        private enum CodingKeys: String, CodingKey {
            case datapoints = "Datapoints"
            case label = "Label"
        }
    }

    public struct GetMetricStreamInput: AWSEncodableShape {
        /// The name of the metric stream to retrieve information about.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct GetMetricStreamOutput: AWSDecodableShape {
        /// The ARN of the metric stream.
        public let arn: String?
        /// The date that the metric stream was created.
        public let creationDate: Date?
        /// If this array of metric namespaces is present, then these namespaces are the only
        /// 			metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in
        /// 		the account are streamed by this metric stream.
        @OptionalCustomCoding<StandardArrayCoder>
        public var excludeFilters: [MetricStreamFilter]?
        /// The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric
        /// 			stream.
        public let firehoseArn: String?
        /// If this array of metric namespaces is present, then these
        /// 			namespaces are the only
        /// 		metric namespaces that are streamed by this metric stream.
        @OptionalCustomCoding<StandardArrayCoder>
        public var includeFilters: [MetricStreamFilter]?
        /// The date of the most recent update to the metric stream's configuration.
        public let lastUpdateDate: Date?
        /// The name of the metric stream.
        public let name: String?
        /// The output format for the stream.
        /// 			Valid values are json and opentelemetry0.7.
        /// 			For more information about metric stream output formats,
        /// 			see Metric streams output formats.
        public let outputFormat: MetricStreamOutputFormat?
        /// The ARN of the IAM role that is used by this metric stream.
        public let roleArn: String?
        /// The state of the metric stream. The possible values are running
        /// 		and stopped.
        public let state: String?
        /// Each entry in this array displays information about one or more metrics that include additional statistics
        /// 			in the metric stream. For more information about the additional statistics, see
        ///
        /// 				CloudWatch statistics definitions.
        @OptionalCustomCoding<StandardArrayCoder>
        public var statisticsConfigurations: [MetricStreamStatisticsConfiguration]?

        public init(arn: String? = nil, creationDate: Date? = nil, excludeFilters: [MetricStreamFilter]? = nil, firehoseArn: String? = nil, includeFilters: [MetricStreamFilter]? = nil, lastUpdateDate: Date? = nil, name: String? = nil, outputFormat: MetricStreamOutputFormat? = nil, roleArn: String? = nil, state: String? = nil, statisticsConfigurations: [MetricStreamStatisticsConfiguration]? = nil) {
            self.arn = arn
            self.creationDate = creationDate
            self.excludeFilters = excludeFilters
            self.firehoseArn = firehoseArn
            self.includeFilters = includeFilters
            self.lastUpdateDate = lastUpdateDate
            self.name = name
            self.outputFormat = outputFormat
            self.roleArn = roleArn
            self.state = state
            self.statisticsConfigurations = statisticsConfigurations
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case creationDate = "CreationDate"
            case excludeFilters = "ExcludeFilters"
            case firehoseArn = "FirehoseArn"
            case includeFilters = "IncludeFilters"
            case lastUpdateDate = "LastUpdateDate"
            case name = "Name"
            case outputFormat = "OutputFormat"
            case roleArn = "RoleArn"
            case state = "State"
            case statisticsConfigurations = "StatisticsConfigurations"
        }
    }

    public struct GetMetricWidgetImageInput: AWSEncodableShape {
        /// A JSON string that defines the bitmap graph to be retrieved. The string includes the
        /// 			metrics to include in the graph, statistics, annotations, title, axis limits, and so on.
        /// 			You can include only one MetricWidget parameter in each GetMetricWidgetImage call. For more information about the syntax of MetricWidget see
        /// 			GetMetricWidgetImage: Metric Widget Structure and Syntax. If any metric on the graph could not load all the requested data points, an orange triangle with an exclamation
        /// 			point appears next to the graph legend.
        public let metricWidget: String
        /// The format of the resulting image. Only PNG images are supported. The default is png. If you specify png, the API returns an HTTP response with the
        /// 			content-type set to text/xml. The image data is in a MetricWidgetImage
        /// 			field. For example:
        /// 			>         iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQEAYAAAAip...            6f0d4192-4d42-11e8-82c1-f539a07e0e3b        The image/png setting is intended only for custom HTTP requests. For most
        /// 			use cases, and all actions using an Amazon Web Services SDK, you should use png. If you specify
        /// 			image/png, the HTTP response has a content-type set to image/png,
        /// 			and the body of the response is a PNG image.
        public let outputFormat: String?

        public init(metricWidget: String, outputFormat: String? = nil) {
            self.metricWidget = metricWidget
            self.outputFormat = outputFormat
        }

        private enum CodingKeys: String, CodingKey {
            case metricWidget = "MetricWidget"
            case outputFormat = "OutputFormat"
        }
    }

    public struct GetMetricWidgetImageOutput: AWSDecodableShape {
        /// The image of the graph, in the output format specified. The output is base64-encoded.
        public let metricWidgetImage: AWSBase64Data?

        public init(metricWidgetImage: AWSBase64Data? = nil) {
            self.metricWidgetImage = metricWidgetImage
        }

        private enum CodingKeys: String, CodingKey {
            case metricWidgetImage = "MetricWidgetImage"
        }
    }

    public struct InsightRule: AWSDecodableShape {
        /// The definition of the rule, as a JSON object. The definition contains the keywords used to define contributors,
        /// 			the value to aggregate on if this rule returns a sum instead of a count, and the filters. For details on the valid syntax, see
        /// 			Contributor Insights
        /// 				Rule Syntax.
        public let definition: String
        /// 			An optional built-in rule that Amazon Web Services manages.
        ///
        public let managedRule: Bool?
        /// The name of the rule.
        public let name: String
        /// For rules that you create, this is always {"Name": "CloudWatchLogRule", "Version": 1}. For managed rules,
        /// 			this is {"Name": "ServiceLogRule", "Version": 1}
        public let schema: String
        /// Indicates whether the rule is enabled or disabled.
        public let state: String

        public init(definition: String, managedRule: Bool? = nil, name: String, schema: String, state: String) {
            self.definition = definition
            self.managedRule = managedRule
            self.name = name
            self.schema = schema
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case definition = "Definition"
            case managedRule = "ManagedRule"
            case name = "Name"
            case schema = "Schema"
            case state = "State"
        }
    }

    public struct InsightRuleContributor: AWSDecodableShape {
        /// An approximation of the aggregate value that comes from this contributor.
        public let approximateAggregateValue: Double
        /// An array of the data points where this contributor is present. Only the data points when this contributor appeared are included in the array.
        @CustomCoding<StandardArrayCoder>
        public var datapoints: [InsightRuleContributorDatapoint]
        /// One of the log entry field keywords that is used to define contributors for this rule.
        @CustomCoding<StandardArrayCoder>
        public var keys: [String]

        public init(approximateAggregateValue: Double, datapoints: [InsightRuleContributorDatapoint], keys: [String]) {
            self.approximateAggregateValue = approximateAggregateValue
            self.datapoints = datapoints
            self.keys = keys
        }

        private enum CodingKeys: String, CodingKey {
            case approximateAggregateValue = "ApproximateAggregateValue"
            case datapoints = "Datapoints"
            case keys = "Keys"
        }
    }

    public struct InsightRuleContributorDatapoint: AWSDecodableShape {
        /// The approximate value that this contributor added during this timestamp.
        public let approximateValue: Double
        /// The timestamp of the data point.
        public let timestamp: Date

        public init(approximateValue: Double, timestamp: Date) {
            self.approximateValue = approximateValue
            self.timestamp = timestamp
        }

        private enum CodingKeys: String, CodingKey {
            case approximateValue = "ApproximateValue"
            case timestamp = "Timestamp"
        }
    }

    public struct InsightRuleMetricDatapoint: AWSDecodableShape {
        /// The average value from all contributors during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request.
        public let average: Double?
        /// The maximum value provided by one contributor during this timestamp. Each timestamp is evaluated separately,
        /// 			so the identity of the max contributor
        /// 		could be different for each timestamp. This statistic is returned only if you included it in the Metrics array in your request.
        public let maxContributorValue: Double?
        /// The maximum value from a single occurence from a single contributor during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request.
        public let maximum: Double?
        /// The minimum value from a single contributor during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request.
        public let minimum: Double?
        /// The number of occurrences that matched the rule during this data point. This statistic is returned only if you included it in the Metrics array in your request.
        public let sampleCount: Double?
        /// The sum of the values from all contributors during the time period represented by that data point. This statistic is returned only if you included it in the Metrics array in your request.
        public let sum: Double?
        /// The timestamp of the data point.
        public let timestamp: Date
        /// The number of unique contributors who published data during this timestamp. This statistic is returned only if you included it in the Metrics array in your request.
        public let uniqueContributors: Double?

        public init(average: Double? = nil, maxContributorValue: Double? = nil, maximum: Double? = nil, minimum: Double? = nil, sampleCount: Double? = nil, sum: Double? = nil, timestamp: Date, uniqueContributors: Double? = nil) {
            self.average = average
            self.maxContributorValue = maxContributorValue
            self.maximum = maximum
            self.minimum = minimum
            self.sampleCount = sampleCount
            self.sum = sum
            self.timestamp = timestamp
            self.uniqueContributors = uniqueContributors
        }

        private enum CodingKeys: String, CodingKey {
            case average = "Average"
            case maxContributorValue = "MaxContributorValue"
            case maximum = "Maximum"
            case minimum = "Minimum"
            case sampleCount = "SampleCount"
            case sum = "Sum"
            case timestamp = "Timestamp"
            case uniqueContributors = "UniqueContributors"
        }
    }

    public struct LabelOptions: AWSEncodableShape {
        /// The time zone to use for metric data return in this operation.
        /// 			The format is + or - followed by four digits.
        /// 			The first two digits indicate the number of hours ahead or behind of UTC, and
        /// 			the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour
        /// 			and 30 minutes ahead of UTC. The default is +0000.
        public let timezone: String?

        public init(timezone: String? = nil) {
            self.timezone = timezone
        }

        private enum CodingKeys: String, CodingKey {
            case timezone = "Timezone"
        }
    }

    public struct ListDashboardsInput: AWSEncodableShape {
        /// If you specify this parameter, only
        /// 			the dashboards with names starting with the specified string are listed. The maximum length is 255, and
        /// 			valid characters are A-Z, a-z, 0-9, ".", "-", and "_".
        ///
        ///
        public let dashboardNamePrefix: String?
        /// The token returned by a previous call to indicate that there is more data available.
        public let nextToken: String?

        public init(dashboardNamePrefix: String? = nil, nextToken: String? = nil) {
            self.dashboardNamePrefix = dashboardNamePrefix
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardNamePrefix = "DashboardNamePrefix"
            case nextToken = "NextToken"
        }
    }

    public struct ListDashboardsOutput: AWSDecodableShape {
        /// The list of matching dashboards.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dashboardEntries: [DashboardEntry]?
        /// The token that marks the start of the next batch of returned results.
        public let nextToken: String?

        public init(dashboardEntries: [DashboardEntry]? = nil, nextToken: String? = nil) {
            self.dashboardEntries = dashboardEntries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardEntries = "DashboardEntries"
            case nextToken = "NextToken"
        }
    }

    public struct ListManagedInsightRulesInput: AWSEncodableShape {
        /// 			The maximum number
        /// 			of results
        /// 			to return
        /// 			in one operation.
        /// 			If you omit this parameter,
        /// 			the default number is used.
        /// 			The default number is 100.
        ///
        public let maxResults: Int?
        /// 			Include this value
        /// 			to get
        /// 			the next set
        /// 			of rules
        /// 			if the value was returned
        /// 			by the previous operation.
        ///
        public let nextToken: String?
        /// 			The ARN
        /// 			of an Amazon Web Services resource
        /// 			that has managed Contributor Insights rules.
        ///
        public let resourceARN: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, resourceARN: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 500)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1024)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListManagedInsightRulesOutput: AWSDecodableShape {
        /// 			The managed rules
        /// 			that are available
        /// 			for the specified Amazon Web Services resource.
        ///
        @OptionalCustomCoding<StandardArrayCoder>
        public var managedRules: [ManagedRuleDescription]?
        /// 			Include this value
        /// 			to get
        /// 			the next set
        /// 			of rules
        /// 			if the value was returned
        /// 			by the previous operation.
        ///
        public let nextToken: String?

        public init(managedRules: [ManagedRuleDescription]? = nil, nextToken: String? = nil) {
            self.managedRules = managedRules
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case managedRules = "ManagedRules"
            case nextToken = "NextToken"
        }
    }

    public struct ListMetricStreamsInput: AWSEncodableShape {
        /// The maximum number of results to return in one operation.
        public let maxResults: Int?
        /// Include this value, if it was returned by the previous call, to get the next set of metric streams.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 500)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListMetricStreamsOutput: AWSDecodableShape {
        /// The array of metric stream information.
        @OptionalCustomCoding<StandardArrayCoder>
        public var entries: [MetricStreamEntry]?
        /// The token that marks the start of the next batch of returned results. You can use this
        /// 		token in a subsequent operation to get the next batch of results.
        public let nextToken: String?

        public init(entries: [MetricStreamEntry]? = nil, nextToken: String? = nil) {
            self.entries = entries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case entries = "Entries"
            case nextToken = "NextToken"
        }
    }

    public struct ListMetricsInput: AWSEncodableShape {
        /// The dimensions to filter against.  Only the dimensions that match exactly
        /// 			will be returned.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [DimensionFilter]?
        /// If you are using this operation in a monitoring account,
        /// 			specify true to include metrics from source accounts in the returned data. The default is false.
        public let includeLinkedAccounts: Bool?
        /// The name of the metric to filter against. Only the metrics with names that match exactly
        /// 			will be returned.
        public let metricName: String?
        /// The metric namespace to filter against. Only the namespace that matches exactly
        /// 		will be returned.
        public let namespace: String?
        /// The token returned by a previous call to indicate that there is more data
        /// 			available.
        public let nextToken: String?
        /// When you use this operation in a monitoring account, use this field to return metrics only from one source account.
        /// 			To do so, specify that source account ID in this field, and also
        /// 		specify true for IncludeLinkedAccounts.
        public let owningAccount: String?
        /// To filter the results to show only metrics that have had data points published
        /// 			in the past three hours, specify this parameter
        /// 			with a value of PT3H. This is the only valid value
        /// 			for this parameter. The results that are returned are an approximation of the value you specify. There
        /// 		is a low probability that the returned results include metrics with last published
        /// 		data as much as 40 minutes more than the specified time interval.
        public let recentlyActive: RecentlyActive?

        public init(dimensions: [DimensionFilter]? = nil, includeLinkedAccounts: Bool? = nil, metricName: String? = nil, namespace: String? = nil, nextToken: String? = nil, owningAccount: String? = nil, recentlyActive: RecentlyActive? = nil) {
            self.dimensions = dimensions
            self.includeLinkedAccounts = includeLinkedAccounts
            self.metricName = metricName
            self.namespace = namespace
            self.nextToken = nextToken
            self.owningAccount = owningAccount
            self.recentlyActive = recentlyActive
        }

        public func validate(name: String) throws {
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 10)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
            try self.validate(self.owningAccount, name: "owningAccount", parent: name, max: 255)
            try self.validate(self.owningAccount, name: "owningAccount", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case dimensions = "Dimensions"
            case includeLinkedAccounts = "IncludeLinkedAccounts"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case nextToken = "NextToken"
            case owningAccount = "OwningAccount"
            case recentlyActive = "RecentlyActive"
        }
    }

    public struct ListMetricsOutput: AWSDecodableShape {
        /// The metrics that match your request.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metrics: [Metric]?
        /// The token that marks the start of the next batch of returned results.
        public let nextToken: String?
        /// If you are using this operation in a monitoring account, this array contains the account IDs of the source
        /// 			accounts where the metrics in the returned data
        /// 		are from. This field is a 1:1 mapping between each metric that is returned and the ID of the owning account.
        @OptionalCustomCoding<StandardArrayCoder>
        public var owningAccounts: [String]?

        public init(metrics: [Metric]? = nil, nextToken: String? = nil, owningAccounts: [String]? = nil) {
            self.metrics = metrics
            self.nextToken = nextToken
            self.owningAccounts = owningAccounts
        }

        private enum CodingKeys: String, CodingKey {
            case metrics = "Metrics"
            case nextToken = "NextToken"
            case owningAccounts = "OwningAccounts"
        }
    }

    public struct ListTagsForResourceInput: AWSEncodableShape {
        /// The ARN of the CloudWatch resource that you want to view tags for. The ARN format of an alarm is
        /// 			arn:aws:cloudwatch:Region:account-id:alarm:alarm-name   The ARN format of a Contributor Insights rule is
        /// 			arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name   For more information about ARN format, see  Resource
        /// 				Types Defined by Amazon CloudWatch in the Amazon Web Services General
        /// 			Reference.
        public let resourceARN: String

        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1024)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceOutput: AWSDecodableShape {
        /// The list of tag keys and values associated with the resource you specified.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct ManagedRule: AWSEncodableShape {
        /// 			The ARN
        /// 			of an Amazon Web Services resource
        /// 			that has managed Contributor Insights rules.
        ///
        public let resourceARN: String
        /// 			A list
        /// 			of key-value pairs
        /// 			that you can associate
        /// 			with a managed Contributor Insights rule.
        /// 			You can associate as many as 50 tags
        /// 			with a rule.
        /// 			Tags can help you organize and categorize your resources.
        /// 			You also can use them
        /// 			to scope user permissions
        /// 			by granting a user permission
        /// 			to access or change only the resources
        /// 			that have certain tag values.
        /// 			To associate tags
        /// 			with a rule,
        /// 			you must have the cloudwatch:TagResource permission
        /// 			in addition
        /// 			to the cloudwatch:PutInsightRule permission.
        /// 			If you are using this operation
        /// 			to update an existing Contributor Insights rule,
        /// 			any tags
        /// 			that you specify
        /// 			in this parameter are ignored.
        /// 			To change the tags
        /// 			of an existing rule,
        /// 			use TagResource.
        ///
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [Tag]?
        /// 			The template name
        /// 			for the managed Contributor Insights rule,
        /// 			as returned
        /// 			by ListManagedInsightRules.
        ///
        public let templateName: String

        public init(resourceARN: String, tags: [Tag]? = nil, templateName: String) {
            self.resourceARN = resourceARN
            self.tags = tags
            self.templateName = templateName
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1024)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.templateName, name: "templateName", parent: name, max: 128)
            try self.validate(self.templateName, name: "templateName", parent: name, min: 1)
            try self.validate(self.templateName, name: "templateName", parent: name, pattern: "^[0-9A-Za-z][\\-\\.\\_0-9A-Za-z]{0,126}[0-9A-Za-z]$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
            case templateName = "TemplateName"
        }
    }

    public struct ManagedRuleDescription: AWSDecodableShape {
        /// 			If a managed rule is enabled,
        /// 			this is the ARN
        /// 			for the related Amazon Web Services resource.
        ///
        public let resourceARN: String?
        /// 			Describes the state
        /// 			of a managed rule.
        /// 			If present,
        /// 			it contains information
        /// 			about the Contributor Insights rule
        /// 			that contains information
        /// 			about the related Amazon Web Services resource.
        ///
        public let ruleState: ManagedRuleState?
        /// 			The template name
        /// 			for the managed rule.
        /// 			Used
        /// 			to enable managed rules using PutManagedInsightRules.
        ///
        public let templateName: String?

        public init(resourceARN: String? = nil, ruleState: ManagedRuleState? = nil, templateName: String? = nil) {
            self.resourceARN = resourceARN
            self.ruleState = ruleState
            self.templateName = templateName
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case ruleState = "RuleState"
            case templateName = "TemplateName"
        }
    }

    public struct ManagedRuleState: AWSDecodableShape {
        /// 			The name
        /// 			of the Contributor Insights rule
        /// 			that contains data
        /// 			for the specified Amazon Web Services resource.
        ///
        public let ruleName: String
        /// 			Indicates whether the rule is enabled or disabled.
        ///
        public let state: String

        public init(ruleName: String, state: String) {
            self.ruleName = ruleName
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case ruleName = "RuleName"
            case state = "State"
        }
    }

    public struct MessageData: AWSDecodableShape {
        /// The error code or status code associated with the message.
        public let code: String?
        /// The message text.
        public let value: String?

        public init(code: String? = nil, value: String? = nil) {
            self.code = code
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case value = "Value"
        }
    }

    public struct Metric: AWSEncodableShape & AWSDecodableShape {
        /// The dimensions for the metric.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The name of the metric. This is a required field.
        public let metricName: String?
        /// The namespace of the metric.
        public let namespace: String?

        public init(dimensions: [Dimension]? = nil, metricName: String? = nil, namespace: String? = nil) {
            self.dimensions = dimensions
            self.metricName = metricName
            self.namespace = namespace
        }

        public func validate(name: String) throws {
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
        }

        private enum CodingKeys: String, CodingKey {
            case dimensions = "Dimensions"
            case metricName = "MetricName"
            case namespace = "Namespace"
        }
    }

    public struct MetricAlarm: AWSDecodableShape {
        /// Indicates whether actions should be executed during any changes to the alarm state.
        public let actionsEnabled: Bool?
        /// The actions to execute when this alarm transitions to the ALARM state
        /// 			from any other state. Each action is specified as an Amazon Resource Name (ARN).
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmActions: [String]?
        /// The Amazon Resource Name (ARN) of the alarm.
        public let alarmArn: String?
        /// The time stamp of the last update to the alarm configuration.
        public let alarmConfigurationUpdatedTimestamp: Date?
        /// The description of the alarm.
        public let alarmDescription: String?
        /// The name of the alarm.
        public let alarmName: String?
        /// The arithmetic operation to use when comparing the specified
        /// 			statistic and threshold. The specified statistic value is used as the first operand.
        public let comparisonOperator: ComparisonOperator?
        /// The number of data points that must be breaching to trigger the alarm.
        public let datapointsToAlarm: Int?
        /// The dimensions for the metric associated with the alarm.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// Used only for alarms based on percentiles. If ignore, the alarm state does not change
        /// 			during periods with too few data points to be statistically significant. If evaluate or this
        /// 			parameter is not used, the alarm is always evaluated and possibly changes state no matter
        /// 			how many data points are available.
        public let evaluateLowSampleCountPercentile: String?
        /// The number of periods over which data is compared to the specified threshold.
        public let evaluationPeriods: Int?
        /// If the value of this field is
        /// 	PARTIAL_DATA, the alarm is being evaluated based on only partial data. This happens if the
        /// 	query used for the alarm returns more than 10,000 metrics. For
        /// 	more information, see
        /// 		Create alarms on Metrics Insights queries.
        public let evaluationState: EvaluationState?
        /// The percentile statistic for the metric associated with the alarm. Specify a value between
        /// 			p0.0 and p100.
        public let extendedStatistic: String?
        /// The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state
        /// 			from any other state. Each action is specified as an Amazon Resource Name (ARN).
        @OptionalCustomCoding<StandardArrayCoder>
        public var insufficientDataActions: [String]?
        /// The name of the metric associated with the alarm, if this is an alarm
        /// 		based on a single metric.
        public let metricName: String?
        /// An array of MetricDataQuery structures, used in an alarm based on a
        /// 			metric math expression. Each structure either retrieves a
        /// 			metric or performs a math expression.
        ///
        /// 			One item in the Metrics array is the math expression that the alarm watches.
        /// 			This expression by designated by having ReturnData set to
        /// 			true.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metrics: [MetricDataQuery]?
        /// The namespace of the metric associated with the alarm.
        public let namespace: String?
        /// The actions to execute when this alarm transitions to the OK state
        /// 			from any other state. Each action is specified as an Amazon Resource Name (ARN).
        @OptionalCustomCoding<StandardArrayCoder>
        public var okActions: [String]?
        /// The period, in seconds, over which the statistic is applied.
        public let period: Int?
        /// An explanation for the alarm state, in text format.
        public let stateReason: String?
        /// An explanation for the alarm state, in JSON format.
        public let stateReasonData: String?
        /// The date and time that the alarm's StateValue most recently changed.
        public let stateTransitionedTimestamp: Date?
        /// The time stamp of the last update to the value of either the
        /// 			StateValue or EvaluationState parameters.
        public let stateUpdatedTimestamp: Date?
        /// The state value for the alarm.
        public let stateValue: StateValue?
        /// The statistic for the metric associated with the alarm, other than percentile.
        /// 		    For percentile statistics, use ExtendedStatistic.
        public let statistic: Statistic?
        /// The value to compare with the specified statistic.
        public let threshold: Double?
        /// In an alarm based on an anomaly detection model, this is the ID of the
        /// 			ANOMALY_DETECTION_BAND function
        /// 			used as the threshold for the alarm.
        public let thresholdMetricId: String?
        /// Sets how this alarm is to handle missing data points. The valid values 	are breaching, notBreaching, ignore, and  	missing. For more information, see 	Configuring how CloudWatch alarms treat missing data. If this parameter is omitted, the default  	behavior of missing is used.
        public let treatMissingData: String?
        /// The unit of the metric associated with the alarm.
        public let unit: StandardUnit?

        public init(actionsEnabled: Bool? = nil, alarmActions: [String]? = nil, alarmArn: String? = nil, alarmConfigurationUpdatedTimestamp: Date? = nil, alarmDescription: String? = nil, alarmName: String? = nil, comparisonOperator: ComparisonOperator? = nil, datapointsToAlarm: Int? = nil, dimensions: [Dimension]? = nil, evaluateLowSampleCountPercentile: String? = nil, evaluationPeriods: Int? = nil, evaluationState: EvaluationState? = nil, extendedStatistic: String? = nil, insufficientDataActions: [String]? = nil, metricName: String? = nil, metrics: [MetricDataQuery]? = nil, namespace: String? = nil, okActions: [String]? = nil, period: Int? = nil, stateReason: String? = nil, stateReasonData: String? = nil, stateTransitionedTimestamp: Date? = nil, stateUpdatedTimestamp: Date? = nil, stateValue: StateValue? = nil, statistic: Statistic? = nil, threshold: Double? = nil, thresholdMetricId: String? = nil, treatMissingData: String? = nil, unit: StandardUnit? = nil) {
            self.actionsEnabled = actionsEnabled
            self.alarmActions = alarmActions
            self.alarmArn = alarmArn
            self.alarmConfigurationUpdatedTimestamp = alarmConfigurationUpdatedTimestamp
            self.alarmDescription = alarmDescription
            self.alarmName = alarmName
            self.comparisonOperator = comparisonOperator
            self.datapointsToAlarm = datapointsToAlarm
            self.dimensions = dimensions
            self.evaluateLowSampleCountPercentile = evaluateLowSampleCountPercentile
            self.evaluationPeriods = evaluationPeriods
            self.evaluationState = evaluationState
            self.extendedStatistic = extendedStatistic
            self.insufficientDataActions = insufficientDataActions
            self.metricName = metricName
            self.metrics = metrics
            self.namespace = namespace
            self.okActions = okActions
            self.period = period
            self.stateReason = stateReason
            self.stateReasonData = stateReasonData
            self.stateTransitionedTimestamp = stateTransitionedTimestamp
            self.stateUpdatedTimestamp = stateUpdatedTimestamp
            self.stateValue = stateValue
            self.statistic = statistic
            self.threshold = threshold
            self.thresholdMetricId = thresholdMetricId
            self.treatMissingData = treatMissingData
            self.unit = unit
        }

        private enum CodingKeys: String, CodingKey {
            case actionsEnabled = "ActionsEnabled"
            case alarmActions = "AlarmActions"
            case alarmArn = "AlarmArn"
            case alarmConfigurationUpdatedTimestamp = "AlarmConfigurationUpdatedTimestamp"
            case alarmDescription = "AlarmDescription"
            case alarmName = "AlarmName"
            case comparisonOperator = "ComparisonOperator"
            case datapointsToAlarm = "DatapointsToAlarm"
            case dimensions = "Dimensions"
            case evaluateLowSampleCountPercentile = "EvaluateLowSampleCountPercentile"
            case evaluationPeriods = "EvaluationPeriods"
            case evaluationState = "EvaluationState"
            case extendedStatistic = "ExtendedStatistic"
            case insufficientDataActions = "InsufficientDataActions"
            case metricName = "MetricName"
            case metrics = "Metrics"
            case namespace = "Namespace"
            case okActions = "OKActions"
            case period = "Period"
            case stateReason = "StateReason"
            case stateReasonData = "StateReasonData"
            case stateTransitionedTimestamp = "StateTransitionedTimestamp"
            case stateUpdatedTimestamp = "StateUpdatedTimestamp"
            case stateValue = "StateValue"
            case statistic = "Statistic"
            case threshold = "Threshold"
            case thresholdMetricId = "ThresholdMetricId"
            case treatMissingData = "TreatMissingData"
            case unit = "Unit"
        }
    }

    public struct MetricDataQuery: AWSEncodableShape & AWSDecodableShape {
        /// The ID of the account where the metrics are located. If you are performing a GetMetricData operation in a monitoring account, use this to specify
        /// 			which account to retrieve this metric from. If you are performing a PutMetricAlarm operation, use this to specify
        /// 			which account contains the metric that the alarm is watching.
        public let accountId: String?
        /// This field can contain either a Metrics Insights query, or a metric math expression to be performed on the
        /// 			returned data. For more information about Metrics Insights queries, see
        /// 			Metrics Insights query components and syntax in the
        /// 			Amazon CloudWatch User Guide. A math expression
        /// 			can use the Id of the other metrics or queries to refer to those metrics, and can also use
        /// 			the Id of other
        /// 			expressions to use the result of those expressions. For more information about metric math expressions, see
        /// 			Metric Math Syntax and Functions in the
        /// 			Amazon CloudWatch User Guide. Within each MetricDataQuery object, you must specify either
        /// 			Expression or MetricStat but not both.
        public let expression: String?
        /// A short name used to tie this object to the results in the response. This name must be
        /// 			unique within a single call to GetMetricData. If you are performing math
        /// 			expressions on this set of data, this name represents that data and can serve as a
        /// 			variable in the mathematical expression. The valid characters are letters, numbers, and
        /// 			underscore. The first character must be a lowercase letter.
        public let id: String
        /// A human-readable label for this metric or expression. This is especially useful
        /// 			if this is an expression, so that you know
        /// 			what the value represents. If the metric or expression is shown in a
        /// 			CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch
        /// 			generates a default. You can put dynamic expressions into a label, so that it is more descriptive.
        /// 			For more information, see Using Dynamic Labels.
        public let label: String?
        /// The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric
        /// 			and not performing a math expression on returned data. Within one MetricDataQuery object, you must specify either
        /// 			Expression or MetricStat but not both.
        public let metricStat: MetricStat?
        /// The granularity, in seconds, of the returned data points. For metrics with regular resolution, a
        /// 			period can be as short as one minute (60 seconds) and must be a multiple of 60.
        /// 			For high-resolution metrics that are collected at intervals of less than one minute,
        /// 			the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics
        /// 			stored by a PutMetricData operation that includes a StorageResolution of 1 second.
        public let period: Int?
        /// When used in GetMetricData, this option indicates whether to return the
        /// 			timestamps and raw data values of this metric. If you are performing this call just to
        /// 			do math expressions and do not also need the raw data returned, you can specify
        /// 				false. If you omit this, the default of true is
        /// 			used. When used in PutMetricAlarm, specify true for the one expression result to use as the alarm. For all
        /// 		other metrics and expressions in the same PutMetricAlarm operation, specify ReturnData as False.
        public let returnData: Bool?

        public init(accountId: String? = nil, expression: String? = nil, id: String, label: String? = nil, metricStat: MetricStat? = nil, period: Int? = nil, returnData: Bool? = nil) {
            self.accountId = accountId
            self.expression = expression
            self.id = id
            self.label = label
            self.metricStat = metricStat
            self.period = period
            self.returnData = returnData
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 255)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 1)
            try self.validate(self.expression, name: "expression", parent: name, max: 2048)
            try self.validate(self.expression, name: "expression", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, max: 255)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.metricStat?.validate(name: "\(name).metricStat")
            try self.validate(self.period, name: "period", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case expression = "Expression"
            case id = "Id"
            case label = "Label"
            case metricStat = "MetricStat"
            case period = "Period"
            case returnData = "ReturnData"
        }
    }

    public struct MetricDataResult: AWSDecodableShape {
        /// The short name you specified to represent this metric.
        public let id: String?
        /// The human-readable label associated with the data.
        public let label: String?
        /// A list of messages with additional information about the data returned.
        @OptionalCustomCoding<StandardArrayCoder>
        public var messages: [MessageData]?
        /// The status of the returned data. Complete indicates that all data points in the requested time range were returned.
        /// 			PartialData means that an incomplete set of data points were returned.
        /// 					You can use the NextToken value that was returned and repeat your request to get more data points.
        /// 			NextToken is not returned if you are performing a math expression. InternalError
        /// 			indicates that an error occurred. Retry your request using NextToken, if present.
        public let statusCode: StatusCode?
        /// The timestamps for the data points, formatted in Unix timestamp format. The number of
        /// 			timestamps always matches the number of values and the value for Timestamps[x] is
        /// 			Values[x].
        @OptionalCustomCoding<StandardArrayCoder>
        public var timestamps: [Date]?
        /// The data points for the metric corresponding to Timestamps. The number of
        /// 			values always matches the number of timestamps and the timestamp for Values[x] is
        /// 			Timestamps[x].
        @OptionalCustomCoding<StandardArrayCoder>
        public var values: [Double]?

        public init(id: String? = nil, label: String? = nil, messages: [MessageData]? = nil, statusCode: StatusCode? = nil, timestamps: [Date]? = nil, values: [Double]? = nil) {
            self.id = id
            self.label = label
            self.messages = messages
            self.statusCode = statusCode
            self.timestamps = timestamps
            self.values = values
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case label = "Label"
            case messages = "Messages"
            case statusCode = "StatusCode"
            case timestamps = "Timestamps"
            case values = "Values"
        }
    }

    public struct MetricDatum: AWSEncodableShape {
        /// Array of numbers that is used along with the Values array. Each number in the Count array
        /// 			is the number of times the corresponding value in the Values array occurred during the period.  If you omit the Counts array, the default of 1 is used as the value for each count. If you
        /// 		include a Counts array, it must include the same amount of values as the Values array.
        @OptionalCustomCoding<StandardArrayCoder>
        public var counts: [Double]?
        /// The dimensions associated with the metric.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The name of the metric.
        public let metricName: String
        /// The statistical values for the metric.
        public let statisticValues: StatisticSet?
        /// Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution metric, so that CloudWatch stores the metric with
        /// 			sub-minute resolution down to one second.
        /// 		Setting this to 60 specifies this metric as a regular-resolution metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution is available
        /// 		only for custom metrics. For more information about high-resolution metrics,
        /// 			see High-Resolution Metrics in the
        /// 			Amazon CloudWatch User Guide.
        /// 		 This field is optional, if you do not specify it the default of 60 is used.
        public let storageResolution: Int?
        /// The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.
        public let timestamp: Date?
        /// When you are using a Put operation, this defines what unit you want to use when storing the metric. In
        /// 		a Get operation, this displays the unit that is used for the metric.
        public let unit: StandardUnit?
        /// The value for the metric. Although the parameter accepts numbers of type Double, CloudWatch rejects values that are either too small or
        /// 			too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity)
        /// 			are not supported.
        public let value: Double?
        /// Array of numbers representing the values for the metric during the period. Each unique value is listed just once
        /// 		in this array, and the corresponding number in the Counts array specifies the number of times that value occurred during the period.
        /// 		You can include up to 150 unique values in each PutMetricData action that specifies a Values array. Although the Values array accepts numbers of type
        /// 			Double, CloudWatch rejects values that are either too small
        /// 			or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity,
        /// 			-Infinity) are not supported.
        @OptionalCustomCoding<StandardArrayCoder>
        public var values: [Double]?

        public init(counts: [Double]? = nil, dimensions: [Dimension]? = nil, metricName: String, statisticValues: StatisticSet? = nil, storageResolution: Int? = nil, timestamp: Date? = nil, unit: StandardUnit? = nil, value: Double? = nil, values: [Double]? = nil) {
            self.counts = counts
            self.dimensions = dimensions
            self.metricName = metricName
            self.statisticValues = statisticValues
            self.storageResolution = storageResolution
            self.timestamp = timestamp
            self.unit = unit
            self.value = value
            self.values = values
        }

        public func validate(name: String) throws {
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.storageResolution, name: "storageResolution", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case counts = "Counts"
            case dimensions = "Dimensions"
            case metricName = "MetricName"
            case statisticValues = "StatisticValues"
            case storageResolution = "StorageResolution"
            case timestamp = "Timestamp"
            case unit = "Unit"
            case value = "Value"
            case values = "Values"
        }
    }

    public struct MetricMathAnomalyDetector: AWSEncodableShape & AWSDecodableShape {
        /// An array of metric data query structures
        /// 			that enables you to create an anomaly detector
        /// 			based on the result of a metric math expression.
        /// 			Each item in MetricDataQueries gets a metric or performs a math expression.
        /// 			One item in MetricDataQueries is the expression
        /// 			that provides the time series
        /// 			that the anomaly detector uses as input.
        /// 			Designate the expression by setting ReturnData to true
        /// 			for this object in the array.
        /// 			For all other expressions and metrics, set ReturnData to false.
        /// 			The designated expression must return
        /// 			a single time series.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metricDataQueries: [MetricDataQuery]?

        public init(metricDataQueries: [MetricDataQuery]? = nil) {
            self.metricDataQueries = metricDataQueries
        }

        public func validate(name: String) throws {
            try self.metricDataQueries?.forEach {
                try $0.validate(name: "\(name).metricDataQueries[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case metricDataQueries = "MetricDataQueries"
        }
    }

    public struct MetricStat: AWSEncodableShape & AWSDecodableShape {
        /// The metric to return, including the metric name, namespace, and dimensions.
        public let metric: Metric
        /// The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can
        /// 			be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected
        /// 			at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics
        /// 			are those metrics stored by a PutMetricData call that includes a StorageResolution of 1 second. If the StartTime parameter specifies a time stamp that is greater than
        /// 				3 hours ago, you must specify the period as follows or no data points in that time range is returned:   Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).   Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).   Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
        public let period: Int
        /// The statistic to return. It can include any CloudWatch statistic or extended statistic.
        public let stat: String
        /// When you are using a Put operation, this defines what unit you want to use when storing the metric. In a Get operation, if you omit Unit then all data that was collected with any unit is returned, along with the corresponding units that were specified
        /// 			when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified.
        /// 			If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.
        public let unit: StandardUnit?

        public init(metric: Metric, period: Int, stat: String, unit: StandardUnit? = nil) {
            self.metric = metric
            self.period = period
            self.stat = stat
            self.unit = unit
        }

        public func validate(name: String) throws {
            try self.metric.validate(name: "\(name).metric")
            try self.validate(self.period, name: "period", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case metric = "Metric"
            case period = "Period"
            case stat = "Stat"
            case unit = "Unit"
        }
    }

    public struct MetricStreamEntry: AWSDecodableShape {
        /// The ARN of the metric stream.
        public let arn: String?
        /// The date that the metric stream was originally created.
        public let creationDate: Date?
        /// The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream.
        public let firehoseArn: String?
        /// The date that the configuration of this metric stream was most recently updated.
        public let lastUpdateDate: Date?
        /// The name of the metric stream.
        public let name: String?
        /// The output format of this metric stream. Valid values are
        /// 			json
        /// 			and opentelemetry0.7.
        public let outputFormat: MetricStreamOutputFormat?
        /// The current state of this stream. Valid values are running and stopped.
        public let state: String?

        public init(arn: String? = nil, creationDate: Date? = nil, firehoseArn: String? = nil, lastUpdateDate: Date? = nil, name: String? = nil, outputFormat: MetricStreamOutputFormat? = nil, state: String? = nil) {
            self.arn = arn
            self.creationDate = creationDate
            self.firehoseArn = firehoseArn
            self.lastUpdateDate = lastUpdateDate
            self.name = name
            self.outputFormat = outputFormat
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case creationDate = "CreationDate"
            case firehoseArn = "FirehoseArn"
            case lastUpdateDate = "LastUpdateDate"
            case name = "Name"
            case outputFormat = "OutputFormat"
            case state = "State"
        }
    }

    public struct MetricStreamFilter: AWSEncodableShape & AWSDecodableShape {
        /// The name of the metric namespace in the filter.
        public let namespace: String?

        public init(namespace: String? = nil) {
            self.namespace = namespace
        }

        public func validate(name: String) throws {
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
        }

        private enum CodingKeys: String, CodingKey {
            case namespace = "Namespace"
        }
    }

    public struct MetricStreamStatisticsConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The list of additional statistics that are to be streamed for the metrics listed
        /// 			in the IncludeMetrics array in this structure. This list can include as many as 20 statistics. If the OutputFormat for the stream is opentelemetry0.7, the only
        /// 			valid values are p?? percentile statistics such as p90, p99 and so on. If the OutputFormat for the stream is json,
        /// 			the valid values include the abbreviations for all of the statistics listed in
        ///
        /// 				CloudWatch statistics definitions. For example, this includes
        /// 			tm98,  wm90, PR(:300), and so on.
        @CustomCoding<StandardArrayCoder>
        public var additionalStatistics: [String]
        /// An array of metric name and namespace pairs that stream the additional statistics listed
        /// 			in the value of the AdditionalStatistics parameter. There can be as many as
        /// 			100 pairs in the array. All metrics that match the combination of metric name and namespace will be streamed
        /// 			with the additional statistics, no matter their dimensions.
        @CustomCoding<StandardArrayCoder>
        public var includeMetrics: [MetricStreamStatisticsMetric]

        public init(additionalStatistics: [String], includeMetrics: [MetricStreamStatisticsMetric]) {
            self.additionalStatistics = additionalStatistics
            self.includeMetrics = includeMetrics
        }

        public func validate(name: String) throws {
            try self.includeMetrics.forEach {
                try $0.validate(name: "\(name).includeMetrics[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case additionalStatistics = "AdditionalStatistics"
            case includeMetrics = "IncludeMetrics"
        }
    }

    public struct MetricStreamStatisticsMetric: AWSEncodableShape & AWSDecodableShape {
        /// The name of the metric.
        public let metricName: String
        /// The namespace of the metric.
        public let namespace: String

        public init(metricName: String, namespace: String) {
            self.metricName = metricName
            self.namespace = namespace
        }

        public func validate(name: String) throws {
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
        }

        private enum CodingKeys: String, CodingKey {
            case metricName = "MetricName"
            case namespace = "Namespace"
        }
    }

    public struct PartialFailure: AWSDecodableShape {
        /// The type of error.
        public let exceptionType: String?
        /// The code of the error.
        public let failureCode: String?
        /// A description of the error.
        public let failureDescription: String?
        /// The specified rule that could not be deleted.
        public let failureResource: String?

        public init(exceptionType: String? = nil, failureCode: String? = nil, failureDescription: String? = nil, failureResource: String? = nil) {
            self.exceptionType = exceptionType
            self.failureCode = failureCode
            self.failureDescription = failureDescription
            self.failureResource = failureResource
        }

        private enum CodingKeys: String, CodingKey {
            case exceptionType = "ExceptionType"
            case failureCode = "FailureCode"
            case failureDescription = "FailureDescription"
            case failureResource = "FailureResource"
        }
    }

    public struct PutAnomalyDetectorInput: AWSEncodableShape {
        /// The configuration specifies details about how the
        /// 			anomaly detection model is to be trained, including
        /// 			time ranges to exclude when training and updating the model.
        /// 			You can specify as many as 10 time ranges. The configuration can also include the time zone to use for
        /// 			the metric.
        public let configuration: AnomalyDetectorConfiguration?
        /// The metric dimensions to create the anomaly detection model for.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The metric math anomaly detector to be created. When using MetricMathAnomalyDetector, you cannot include the following parameters in the same operation:    Dimensions     MetricName     Namespace     Stat    the SingleMetricAnomalyDetector parameters of PutAnomalyDetectorInput    Instead, specify the metric math anomaly detector attributes
        /// 			as part of the property MetricMathAnomalyDetector.
        public let metricMathAnomalyDetector: MetricMathAnomalyDetector?
        /// The name of the metric to create the anomaly detection model for.
        public let metricName: String?
        /// The namespace of the metric to create the anomaly detection model for.
        public let namespace: String?
        /// A single metric anomaly detector to be created. When using SingleMetricAnomalyDetector,
        /// 			you cannot include the following parameters in the same operation:    Dimensions     MetricName     Namespace     Stat    the MetricMatchAnomalyDetector parameters of PutAnomalyDetectorInput    Instead, specify the single metric anomaly detector attributes
        /// 			as part of the property SingleMetricAnomalyDetector.
        public let singleMetricAnomalyDetector: SingleMetricAnomalyDetector?
        /// The statistic to use for the metric and the anomaly detection model.
        public let stat: String?

        public init(configuration: AnomalyDetectorConfiguration? = nil, metricMathAnomalyDetector: MetricMathAnomalyDetector? = nil, singleMetricAnomalyDetector: SingleMetricAnomalyDetector? = nil) {
            self.configuration = configuration
            self.dimensions = nil
            self.metricMathAnomalyDetector = metricMathAnomalyDetector
            self.metricName = nil
            self.namespace = nil
            self.singleMetricAnomalyDetector = singleMetricAnomalyDetector
            self.stat = nil
        }

        @available(*, deprecated, message: "Members dimensions, metricName, namespace, stat have been deprecated")
        public init(configuration: AnomalyDetectorConfiguration? = nil, dimensions: [Dimension]? = nil, metricMathAnomalyDetector: MetricMathAnomalyDetector? = nil, metricName: String? = nil, namespace: String? = nil, singleMetricAnomalyDetector: SingleMetricAnomalyDetector? = nil, stat: String? = nil) {
            self.configuration = configuration
            self.dimensions = dimensions
            self.metricMathAnomalyDetector = metricMathAnomalyDetector
            self.metricName = metricName
            self.namespace = namespace
            self.singleMetricAnomalyDetector = singleMetricAnomalyDetector
            self.stat = stat
        }

        public func validate(name: String) throws {
            try self.configuration?.validate(name: "\(name).configuration")
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.metricMathAnomalyDetector?.validate(name: "\(name).metricMathAnomalyDetector")
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
            try self.singleMetricAnomalyDetector?.validate(name: "\(name).singleMetricAnomalyDetector")
            try self.validate(self.stat, name: "stat", parent: name, max: 50)
            try self.validate(self.stat, name: "stat", parent: name, pattern: "^(SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm)(\\d{1,2}(\\.\\d{0,10})?|100)|[ou]\\d+(\\.\\d*)?)(_E|_L|_H)?|(TM|TC|TS|WM)\\(((((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%)?:((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%|((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%:(((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%)?)\\)|(TM|TC|TS|WM|PR)\\(((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)):((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))?|((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))?:(\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))\\)$")
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "Configuration"
            case dimensions = "Dimensions"
            case metricMathAnomalyDetector = "MetricMathAnomalyDetector"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case singleMetricAnomalyDetector = "SingleMetricAnomalyDetector"
            case stat = "Stat"
        }
    }

    public struct PutAnomalyDetectorOutput: AWSDecodableShape {
        public init() {}
    }

    public struct PutCompositeAlarmInput: AWSEncodableShape {
        /// Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is
        /// 			TRUE.
        public let actionsEnabled: Bool?
        /// 			Actions will be suppressed
        /// 			if the suppressor alarm is
        /// 			in the ALARM state.
        /// 			ActionsSuppressor can be an AlarmName or an Amazon Resource Name (ARN)
        /// 			from an existing alarm.
        ///
        public let actionsSuppressor: String?
        /// 			The maximum time
        /// 			in seconds
        /// 			that the composite alarm waits
        /// 			after suppressor alarm goes out
        /// 			of the ALARM state.
        /// 			After this time,
        /// 			the composite alarm performs its actions.
        /// 		   ExtensionPeriod
        /// 				is required only
        /// 				when ActionsSuppressor is specified.
        ///
        public let actionsSuppressorExtensionPeriod: Int?
        /// 			The maximum time
        /// 			in seconds
        /// 			that the composite alarm waits
        /// 			for the suppressor alarm
        /// 			to go
        /// 			into the ALARM state.
        /// 			After this time,
        /// 			the composite alarm performs its actions.
        /// 		   WaitPeriod
        /// 				is required only
        /// 				when ActionsSuppressor is specified.
        ///
        public let actionsSuppressorWaitPeriod: Int?
        /// The actions to execute when this alarm transitions to the ALARM state from any other state.
        /// 			Each action is specified as an Amazon Resource Name (ARN). Valid Values: arn:aws:sns:region:account-id:sns-topic-name
        /// 			| arn:aws:ssm:region:account-id:opsitem:severity
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmActions: [String]?
        /// The description for the composite alarm.
        public let alarmDescription: String?
        /// The name for the composite alarm. This name must be unique within the Region.
        public let alarmName: String
        /// An expression that specifies which other alarms are to be evaluated to determine this
        /// 			composite alarm's state. For each alarm that you reference, you
        /// 			designate a function that
        /// 			specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You
        /// 			can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the
        /// 			functions in your expression. You can use either alarm names or ARNs to reference the other alarms that are to be evaluated. Functions can include the following:    ALARM("alarm-name or alarm-ARN") is TRUE if the named
        /// 			alarm is in ALARM state.    OK("alarm-name or alarm-ARN") is TRUE if the named
        /// 				alarm is in OK state.    INSUFFICIENT_DATA("alarm-name or alarm-ARN") is TRUE if the named
        /// 				alarm is in INSUFFICIENT_DATA state.    TRUE always evaluates to TRUE.    FALSE always evaluates to FALSE.   TRUE and FALSE are useful for testing a complex AlarmRule structure, and
        /// 		for testing your alarm actions. Alarm names specified in AlarmRule can be surrounded with double-quotes ("), but do not have to be. The following
        /// 			are some examples of AlarmRule:    ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh) specifies that the composite alarm goes into ALARM state only
        /// 				if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state.    ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)
        /// 					specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state
        /// 					and DeploymentInProgress is not in ALARM state. This example reduces
        /// 					alarm noise during a known deployment window.    (ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh) goes into ALARM
        /// 				state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state.
        /// 				This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an
        /// 				alarm action on high CPU or disk usage if a known network problem is also occurring.   The AlarmRule can specify as many as 100
        /// 			"children" alarms. The AlarmRule expression can have as many as 500 elements. Elements
        /// 			are child alarms, TRUE or FALSE statements, and
        /// 			parentheses.
        public let alarmRule: String
        /// The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
        /// 			Each action is specified as an Amazon Resource Name (ARN). Valid Values: arn:aws:sns:region:account-id:sns-topic-name
        @OptionalCustomCoding<StandardArrayCoder>
        public var insufficientDataActions: [String]?
        /// The actions to execute when this alarm transitions to an OK state
        /// 			from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid Values: arn:aws:sns:region:account-id:sns-topic-name
        @OptionalCustomCoding<StandardArrayCoder>
        public var okActions: [String]?
        /// A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm. Tags can help you organize and categorize your
        /// 			resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with
        /// 			certain tag values.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [Tag]?

        public init(actionsEnabled: Bool? = nil, actionsSuppressor: String? = nil, actionsSuppressorExtensionPeriod: Int? = nil, actionsSuppressorWaitPeriod: Int? = nil, alarmActions: [String]? = nil, alarmDescription: String? = nil, alarmName: String, alarmRule: String, insufficientDataActions: [String]? = nil, okActions: [String]? = nil, tags: [Tag]? = nil) {
            self.actionsEnabled = actionsEnabled
            self.actionsSuppressor = actionsSuppressor
            self.actionsSuppressorExtensionPeriod = actionsSuppressorExtensionPeriod
            self.actionsSuppressorWaitPeriod = actionsSuppressorWaitPeriod
            self.alarmActions = alarmActions
            self.alarmDescription = alarmDescription
            self.alarmName = alarmName
            self.alarmRule = alarmRule
            self.insufficientDataActions = insufficientDataActions
            self.okActions = okActions
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.actionsSuppressor, name: "actionsSuppressor", parent: name, max: 1600)
            try self.validate(self.actionsSuppressor, name: "actionsSuppressor", parent: name, min: 1)
            try self.alarmActions?.forEach {
                try validate($0, name: "alarmActions[]", parent: name, max: 1024)
                try validate($0, name: "alarmActions[]", parent: name, min: 1)
            }
            try self.validate(self.alarmActions, name: "alarmActions", parent: name, max: 5)
            try self.validate(self.alarmDescription, name: "alarmDescription", parent: name, max: 1024)
            try self.validate(self.alarmName, name: "alarmName", parent: name, max: 255)
            try self.validate(self.alarmName, name: "alarmName", parent: name, min: 1)
            try self.validate(self.alarmRule, name: "alarmRule", parent: name, max: 10240)
            try self.validate(self.alarmRule, name: "alarmRule", parent: name, min: 1)
            try self.insufficientDataActions?.forEach {
                try validate($0, name: "insufficientDataActions[]", parent: name, max: 1024)
                try validate($0, name: "insufficientDataActions[]", parent: name, min: 1)
            }
            try self.validate(self.insufficientDataActions, name: "insufficientDataActions", parent: name, max: 5)
            try self.okActions?.forEach {
                try validate($0, name: "okActions[]", parent: name, max: 1024)
                try validate($0, name: "okActions[]", parent: name, min: 1)
            }
            try self.validate(self.okActions, name: "okActions", parent: name, max: 5)
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case actionsEnabled = "ActionsEnabled"
            case actionsSuppressor = "ActionsSuppressor"
            case actionsSuppressorExtensionPeriod = "ActionsSuppressorExtensionPeriod"
            case actionsSuppressorWaitPeriod = "ActionsSuppressorWaitPeriod"
            case alarmActions = "AlarmActions"
            case alarmDescription = "AlarmDescription"
            case alarmName = "AlarmName"
            case alarmRule = "AlarmRule"
            case insufficientDataActions = "InsufficientDataActions"
            case okActions = "OKActions"
            case tags = "Tags"
        }
    }

    public struct PutDashboardInput: AWSEncodableShape {
        /// The detailed information about the dashboard in JSON format, including the widgets to include and their location
        /// 			on the dashboard.  This parameter is required. For more information about the syntax,
        /// 			see  Dashboard Body Structure and Syntax.
        public let dashboardBody: String
        /// The name of the dashboard. If a dashboard with this name already exists, this call modifies that dashboard, replacing
        /// 			its current contents. Otherwise, a new dashboard is created. The maximum length is 255, and valid characters are
        /// 			A-Z, a-z, 0-9, "-", and "_".  This parameter is required.
        public let dashboardName: String

        public init(dashboardBody: String, dashboardName: String) {
            self.dashboardBody = dashboardBody
            self.dashboardName = dashboardName
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardBody = "DashboardBody"
            case dashboardName = "DashboardName"
        }
    }

    public struct PutDashboardOutput: AWSDecodableShape {
        /// If the input for PutDashboard was correct and the dashboard was successfully created or modified, this result is empty. If this result includes only warning messages, then the input was valid enough for the dashboard to be
        /// 			created or modified, but some elements of the dashboard
        /// 			might not render. If this result includes error messages, the input was not valid and the operation failed.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dashboardValidationMessages: [DashboardValidationMessage]?

        public init(dashboardValidationMessages: [DashboardValidationMessage]? = nil) {
            self.dashboardValidationMessages = dashboardValidationMessages
        }

        private enum CodingKeys: String, CodingKey {
            case dashboardValidationMessages = "DashboardValidationMessages"
        }
    }

    public struct PutInsightRuleInput: AWSEncodableShape {
        /// The definition of the rule, as a JSON object. For details on the valid syntax, see
        /// 			Contributor Insights
        /// 			Rule Syntax.
        public let ruleDefinition: String
        /// A unique name for the rule.
        public let ruleName: String
        /// The state of the rule. Valid values are ENABLED and DISABLED.
        public let ruleState: String?
        /// A list of key-value pairs to associate with the Contributor Insights rule.
        /// 			You can associate as many as 50 tags with a rule. Tags can help you organize and categorize your
        /// 			resources. You can also use them to scope user permissions, by
        /// 			granting a user permission to access or change only the resources that have
        /// 			certain tag values. To be able to associate tags with a rule, you must have the cloudwatch:TagResource
        /// 		permission in addition to the cloudwatch:PutInsightRule permission. If you are using this operation to update an existing Contributor Insights rule, any tags
        /// 		you specify in this parameter are ignored. To change the tags of an existing rule, use
        /// 			TagResource.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [Tag]?

        public init(ruleDefinition: String, ruleName: String, ruleState: String? = nil, tags: [Tag]? = nil) {
            self.ruleDefinition = ruleDefinition
            self.ruleName = ruleName
            self.ruleState = ruleState
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.ruleDefinition, name: "ruleDefinition", parent: name, max: 8192)
            try self.validate(self.ruleDefinition, name: "ruleDefinition", parent: name, min: 1)
            try self.validate(self.ruleDefinition, name: "ruleDefinition", parent: name, pattern: "^[\\x00-\\x7F]+$")
            try self.validate(self.ruleName, name: "ruleName", parent: name, max: 128)
            try self.validate(self.ruleName, name: "ruleName", parent: name, min: 1)
            try self.validate(self.ruleName, name: "ruleName", parent: name, pattern: "^[\\x20-\\x7E]+$")
            try self.validate(self.ruleState, name: "ruleState", parent: name, max: 32)
            try self.validate(self.ruleState, name: "ruleState", parent: name, min: 1)
            try self.validate(self.ruleState, name: "ruleState", parent: name, pattern: "^[\\x20-\\x7E]+$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case ruleDefinition = "RuleDefinition"
            case ruleName = "RuleName"
            case ruleState = "RuleState"
            case tags = "Tags"
        }
    }

    public struct PutInsightRuleOutput: AWSDecodableShape {
        public init() {}
    }

    public struct PutManagedInsightRulesInput: AWSEncodableShape {
        /// 			A list
        /// 			of ManagedRules
        /// 			to enable.
        ///
        @CustomCoding<StandardArrayCoder>
        public var managedRules: [ManagedRule]

        public init(managedRules: [ManagedRule]) {
            self.managedRules = managedRules
        }

        public func validate(name: String) throws {
            try self.managedRules.forEach {
                try $0.validate(name: "\(name).managedRules[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case managedRules = "ManagedRules"
        }
    }

    public struct PutManagedInsightRulesOutput: AWSDecodableShape {
        /// 			An array
        /// 			that lists the rules
        /// 			that could not be enabled.
        ///
        @OptionalCustomCoding<StandardArrayCoder>
        public var failures: [PartialFailure]?

        public init(failures: [PartialFailure]? = nil) {
            self.failures = failures
        }

        private enum CodingKeys: String, CodingKey {
            case failures = "Failures"
        }
    }

    public struct PutMetricAlarmInput: AWSEncodableShape {
        /// Indicates whether actions should be executed during any changes to the alarm state. The default is
        /// 			TRUE.
        public let actionsEnabled: Bool?
        /// The actions to execute when this alarm transitions to the ALARM state from any other state.
        /// 			Each action is specified as an Amazon Resource Name (ARN). Valid Values: arn:aws:automate:region:ec2:stop |
        /// 			arn:aws:automate:region:ec2:terminate |
        /// 			arn:aws:automate:region:ec2:recover |
        /// 			arn:aws:automate:region:ec2:reboot |
        /// 			arn:aws:sns:region:account-id:sns-topic-name |
        /// 			arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
        /// 			| arn:aws:ssm:region:account-id:opsitem:severity
        /// 			| arn:aws:ssm-incidents::account-id:response-plan:response-plan-name   Valid Values (for use with IAM roles):
        /// 			arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0 |
        /// 				arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0 |
        /// 				arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0 |
        /// 			arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarmActions: [String]?
        /// The description for the alarm.
        public let alarmDescription: String?
        /// The name for the alarm. This name must be unique within the Region.
        public let alarmName: String
        ///  The arithmetic operation to use when comparing the specified statistic and
        /// 			threshold. The specified statistic value is used as the first operand. The values LessThanLowerOrGreaterThanUpperThreshold,
        /// 			LessThanLowerThreshold, and GreaterThanUpperThreshold
        /// 		are used only for alarms based on anomaly detection models.
        public let comparisonOperator: ComparisonOperator
        /// The number of data points that must be breaching to trigger the alarm. This is used only if you are setting
        /// 			an "M out of N" alarm. In that case, this value is the M. For more information, see
        /// 			Evaluating an Alarm in the
        /// 			Amazon CloudWatch User Guide.
        public let datapointsToAlarm: Int?
        /// The dimensions for the metric specified in MetricName.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        ///  Used only for alarms based on percentiles. If you specify ignore, the alarm state does not change during periods with too few data points to be
        /// 			statistically significant. If you specify evaluate or omit this parameter, the alarm is always evaluated and possibly changes state
        /// 			no matter how many data points are available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples. Valid Values: evaluate | ignore
        public let evaluateLowSampleCountPercentile: String?
        /// The number of periods over which data is compared to the specified threshold. If you are
        /// 			setting an alarm that requires that a number of consecutive data points be breaching to
        /// 			trigger the alarm, this value specifies that number. If you are setting an "M out of N"
        /// 			alarm, this value is the N. An alarm's total current evaluation period can
        /// 			be no longer than one day, so this number multiplied by Period cannot be more than 86,400 seconds.
        public let evaluationPeriods: Int
        /// The percentile statistic for the metric specified in MetricName. Specify a value
        /// 			between p0.0 and p100. When you call PutMetricAlarm and specify
        /// 			a MetricName, you must
        /// 			specify either Statistic or ExtendedStatistic, but not both.
        public let extendedStatistic: String?
        /// The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
        /// 			Each action is specified as an Amazon Resource Name (ARN). Valid Values: arn:aws:automate:region:ec2:stop |
        /// 			arn:aws:automate:region:ec2:terminate |
        /// 			arn:aws:automate:region:ec2:recover |
        /// 			arn:aws:automate:region:ec2:reboot |
        /// 			arn:aws:sns:region:account-id:sns-topic-name |
        /// 			arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name   Valid Values (for use with IAM roles):
        /// 			>arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0 |
        /// 				arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0 |
        /// 				arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
        @OptionalCustomCoding<StandardArrayCoder>
        public var insufficientDataActions: [String]?
        /// The name for the metric associated with the alarm. For each PutMetricAlarm
        /// 		operation, you must specify either MetricName or a Metrics array. If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
        /// 			Dimensions, Period,
        /// 			Namespace, Statistic, or ExtendedStatistic parameters. Instead, you specify
        /// 		all this information in the Metrics array.
        public let metricName: String?
        /// An array of MetricDataQuery structures that enable you to create an alarm based on the result of a
        /// 			metric math expression. For each PutMetricAlarm
        /// 			operation, you must specify either MetricName or a Metrics array. Each item in the Metrics array either retrieves a metric or performs a math expression. One item in the Metrics array is the expression that the alarm watches. You designate this expression
        /// 			by setting ReturnData to true for this object in the array. For more information, see MetricDataQuery. If you use the Metrics parameter, you cannot include the MetricName, Dimensions, Period,
        /// 			Namespace, Statistic, or ExtendedStatistic parameters of PutMetricAlarm in the same operation.
        /// 			Instead, you retrieve
        /// 		the metrics you are using in your math expression as part of the Metrics array.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metrics: [MetricDataQuery]?
        /// The namespace for the metric associated specified in MetricName.
        public let namespace: String?
        /// The actions to execute when this alarm transitions to an OK state
        /// 			from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid Values: arn:aws:automate:region:ec2:stop |
        /// 			arn:aws:automate:region:ec2:terminate |
        /// 			arn:aws:automate:region:ec2:recover |
        /// 			arn:aws:automate:region:ec2:reboot |
        /// 			arn:aws:sns:region:account-id:sns-topic-name |
        /// 			arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name   Valid Values (for use with IAM roles):
        /// 			arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0 |
        /// 				arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0 |
        /// 				arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0 |
        /// 			    arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
        @OptionalCustomCoding<StandardArrayCoder>
        public var okActions: [String]?
        /// The length, in seconds, used each time the metric specified in MetricName is
        /// 			evaluated. Valid values are 10, 30, and any multiple of 60.  Period is required for alarms based on static thresholds. If
        /// 		you are creating an alarm based on a metric math expression, you specify the
        /// 		period for each metric within the objects in the Metrics array. Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData call with a
        /// 				StorageResolution of 1. If you specify a period of 10 or 30 for a metric that does not have
        /// 			sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case,
        /// 			it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm
        /// 			might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution alarm,
        /// 			which has a higher charge than other alarms. For more information about pricing, see Amazon CloudWatch Pricing. An alarm's total current evaluation period can
        /// 		be no longer than one day, so Period multiplied by EvaluationPeriods cannot be more than 86,400 seconds.
        public let period: Int?
        /// The statistic for the metric specified in MetricName, other than percentile.
        /// 		    For percentile statistics, use ExtendedStatistic. When you call PutMetricAlarm and specify
        /// 			a MetricName, you must
        /// 		specify either Statistic or ExtendedStatistic, but not both.
        public let statistic: Statistic?
        /// A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. Tags can help you organize and categorize your resources. You can also use them to scope user
        /// 			permissions by granting a user
        /// 			permission to access or change only resources with certain tag values. If you are using this operation to update an existing alarm, any tags
        /// 			you specify in this parameter are ignored. To change the tags of an existing alarm, use
        /// 			TagResource
        /// 			or UntagResource.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [Tag]?
        /// The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should
        /// 		not be used for alarms based on anomaly detection models.
        public let threshold: Double?
        /// If this is an alarm based on an anomaly detection model, make this value match
        /// 			the ID of
        /// 			the ANOMALY_DETECTION_BAND function. For an example of how to use this parameter, see the
        /// 			Anomaly Detection
        /// 		Model Alarm example on this page. If your alarm uses this parameter, it cannot have Auto Scaling actions.
        public let thresholdMetricId: String?
        ///  Sets how this alarm is to handle missing data points. If TreatMissingData is omitted, the default behavior of missing is used.
        /// 			For more information, see Configuring How CloudWatch
        /// 				Alarms Treats Missing Data. Valid Values: breaching | notBreaching | ignore | missing   Alarms that evaluate metrics in the AWS/DynamoDB namespace always ignore
        /// 			missing data even if you choose a different option for TreatMissingData. When an
        /// 			AWS/DynamoDB metric has missing data, alarms that evaluate that metric remain in their current state.
        public let treatMissingData: String?
        /// The unit of measure for the statistic. For example, the units for the Amazon EC2
        /// 			NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance
        /// 			receives on all network interfaces. You can also specify a unit when you create a custom
        /// 			metric. Units help provide conceptual meaning to your data. Metric data points that
        /// 			specify a unit of measure, such as Percent, are aggregated separately. If you don't specify Unit, CloudWatch retrieves all unit types that have been published for the
        /// 			metric and attempts to evaluate the alarm.
        /// 			Usually, metrics are
        /// 			published with only one unit, so the alarm
        /// 			works as intended. However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
        /// 			behavior is not defined and
        /// 			it behaves unpredictably. We recommend omitting Unit so that you don't inadvertently
        /// 			specify an incorrect unit that is not published for this metric. Doing so
        /// 			causes the alarm to be stuck in the INSUFFICIENT DATA state.
        public let unit: StandardUnit?

        public init(actionsEnabled: Bool? = nil, alarmActions: [String]? = nil, alarmDescription: String? = nil, alarmName: String, comparisonOperator: ComparisonOperator, datapointsToAlarm: Int? = nil, dimensions: [Dimension]? = nil, evaluateLowSampleCountPercentile: String? = nil, evaluationPeriods: Int, extendedStatistic: String? = nil, insufficientDataActions: [String]? = nil, metricName: String? = nil, metrics: [MetricDataQuery]? = nil, namespace: String? = nil, okActions: [String]? = nil, period: Int? = nil, statistic: Statistic? = nil, tags: [Tag]? = nil, threshold: Double? = nil, thresholdMetricId: String? = nil, treatMissingData: String? = nil, unit: StandardUnit? = nil) {
            self.actionsEnabled = actionsEnabled
            self.alarmActions = alarmActions
            self.alarmDescription = alarmDescription
            self.alarmName = alarmName
            self.comparisonOperator = comparisonOperator
            self.datapointsToAlarm = datapointsToAlarm
            self.dimensions = dimensions
            self.evaluateLowSampleCountPercentile = evaluateLowSampleCountPercentile
            self.evaluationPeriods = evaluationPeriods
            self.extendedStatistic = extendedStatistic
            self.insufficientDataActions = insufficientDataActions
            self.metricName = metricName
            self.metrics = metrics
            self.namespace = namespace
            self.okActions = okActions
            self.period = period
            self.statistic = statistic
            self.tags = tags
            self.threshold = threshold
            self.thresholdMetricId = thresholdMetricId
            self.treatMissingData = treatMissingData
            self.unit = unit
        }

        public func validate(name: String) throws {
            try self.alarmActions?.forEach {
                try validate($0, name: "alarmActions[]", parent: name, max: 1024)
                try validate($0, name: "alarmActions[]", parent: name, min: 1)
            }
            try self.validate(self.alarmActions, name: "alarmActions", parent: name, max: 5)
            try self.validate(self.alarmDescription, name: "alarmDescription", parent: name, max: 1024)
            try self.validate(self.alarmName, name: "alarmName", parent: name, max: 255)
            try self.validate(self.alarmName, name: "alarmName", parent: name, min: 1)
            try self.validate(self.datapointsToAlarm, name: "datapointsToAlarm", parent: name, min: 1)
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.validate(self.evaluateLowSampleCountPercentile, name: "evaluateLowSampleCountPercentile", parent: name, max: 255)
            try self.validate(self.evaluateLowSampleCountPercentile, name: "evaluateLowSampleCountPercentile", parent: name, min: 1)
            try self.validate(self.evaluationPeriods, name: "evaluationPeriods", parent: name, min: 1)
            try self.insufficientDataActions?.forEach {
                try validate($0, name: "insufficientDataActions[]", parent: name, max: 1024)
                try validate($0, name: "insufficientDataActions[]", parent: name, min: 1)
            }
            try self.validate(self.insufficientDataActions, name: "insufficientDataActions", parent: name, max: 5)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.metrics?.forEach {
                try $0.validate(name: "\(name).metrics[]")
            }
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
            try self.okActions?.forEach {
                try validate($0, name: "okActions[]", parent: name, max: 1024)
                try validate($0, name: "okActions[]", parent: name, min: 1)
            }
            try self.validate(self.okActions, name: "okActions", parent: name, max: 5)
            try self.validate(self.period, name: "period", parent: name, min: 1)
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.thresholdMetricId, name: "thresholdMetricId", parent: name, max: 255)
            try self.validate(self.thresholdMetricId, name: "thresholdMetricId", parent: name, min: 1)
            try self.validate(self.treatMissingData, name: "treatMissingData", parent: name, max: 255)
            try self.validate(self.treatMissingData, name: "treatMissingData", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case actionsEnabled = "ActionsEnabled"
            case alarmActions = "AlarmActions"
            case alarmDescription = "AlarmDescription"
            case alarmName = "AlarmName"
            case comparisonOperator = "ComparisonOperator"
            case datapointsToAlarm = "DatapointsToAlarm"
            case dimensions = "Dimensions"
            case evaluateLowSampleCountPercentile = "EvaluateLowSampleCountPercentile"
            case evaluationPeriods = "EvaluationPeriods"
            case extendedStatistic = "ExtendedStatistic"
            case insufficientDataActions = "InsufficientDataActions"
            case metricName = "MetricName"
            case metrics = "Metrics"
            case namespace = "Namespace"
            case okActions = "OKActions"
            case period = "Period"
            case statistic = "Statistic"
            case tags = "Tags"
            case threshold = "Threshold"
            case thresholdMetricId = "ThresholdMetricId"
            case treatMissingData = "TreatMissingData"
            case unit = "Unit"
        }
    }

    public struct PutMetricDataInput: AWSEncodableShape {
        /// The data for the metric. The array can include no more than 1000 metrics per call.
        @CustomCoding<StandardArrayCoder>
        public var metricData: [MetricDatum]
        /// The namespace for the metric data. To avoid conflicts
        /// 			with Amazon Web Services service namespaces, you should not specify a namespace that begins with AWS/
        public let namespace: String

        public init(metricData: [MetricDatum], namespace: String) {
            self.metricData = metricData
            self.namespace = namespace
        }

        public func validate(name: String) throws {
            try self.metricData.forEach {
                try $0.validate(name: "\(name).metricData[]")
            }
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
        }

        private enum CodingKeys: String, CodingKey {
            case metricData = "MetricData"
            case namespace = "Namespace"
        }
    }

    public struct PutMetricStreamInput: AWSEncodableShape {
        /// If you specify this parameter, the stream sends metrics from all
        /// 			metric namespaces except for the namespaces that you specify here. You cannot include ExcludeFilters and IncludeFilters in
        /// 			the same operation.
        @OptionalCustomCoding<StandardArrayCoder>
        public var excludeFilters: [MetricStreamFilter]?
        /// The ARN of the Amazon Kinesis Data Firehose delivery stream to use for this metric stream.
        /// 			This Amazon Kinesis Data Firehose delivery stream must already exist and must be in the
        /// 			same account as the metric stream.
        public let firehoseArn: String
        /// If you specify this parameter, the stream sends only the
        /// 		metrics from the metric namespaces that you specify here. You cannot include IncludeFilters and ExcludeFilters
        /// 		in the same operation.
        @OptionalCustomCoding<StandardArrayCoder>
        public var includeFilters: [MetricStreamFilter]?
        /// If you are creating a new metric stream, this is the name for the new stream. The name
        /// 		must be different than the names of other metric streams in this account and Region. If you are updating a metric stream, specify the name of that stream here. Valid characters are A-Z, a-z, 0-9, "-" and "_".
        public let name: String
        /// The output format for the stream. Valid values are json
        /// 		and opentelemetry0.7. For more information about metric stream
        /// 		output formats, see
        ///
        /// 				Metric streams output formats.
        public let outputFormat: MetricStreamOutputFormat
        /// The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Data
        /// 			Firehose resources. This IAM role must already exist and must be in the same account as
        /// 			the metric stream. This IAM role must include the following permissions:   firehose:PutRecord   firehose:PutRecordBatch
        public let roleArn: String
        /// By default, a metric stream always sends the MAX, MIN, SUM,
        /// 			and SAMPLECOUNT statistics for each metric that is streamed. You can use this parameter to have
        /// 			the metric stream also send additional statistics in the stream. This
        /// 			array can have up to 100 members. For each entry in this array, you specify one or more metrics and the list of additional
        /// 			statistics to stream for those metrics. The additional statistics that you can stream
        /// 			depend on the stream's OutputFormat. If the OutputFormat is
        /// 				json, you can stream any additional statistic that is supported by
        /// 				CloudWatch, listed in
        /// 				CloudWatch statistics definitions. If the OutputFormat
        /// 			is opentelemetry0.7, you can stream percentile statistics such as p95,
        /// 			p99.9, and so on.
        @OptionalCustomCoding<StandardArrayCoder>
        public var statisticsConfigurations: [MetricStreamStatisticsConfiguration]?
        /// A list of key-value pairs to associate with the metric stream. You can associate as
        /// 			many as 50 tags with a metric stream. Tags can help you organize and categorize your resources. You can also use them to scope user
        /// 			permissions by granting a user
        /// 			permission to access or change only resources with certain tag values. You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags
        /// 			you specify in this parameter are ignored. To change the tags of an existing metric stream, use
        /// 			TagResource
        /// 			or UntagResource.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [Tag]?

        public init(excludeFilters: [MetricStreamFilter]? = nil, firehoseArn: String, includeFilters: [MetricStreamFilter]? = nil, name: String, outputFormat: MetricStreamOutputFormat, roleArn: String, statisticsConfigurations: [MetricStreamStatisticsConfiguration]? = nil, tags: [Tag]? = nil) {
            self.excludeFilters = excludeFilters
            self.firehoseArn = firehoseArn
            self.includeFilters = includeFilters
            self.name = name
            self.outputFormat = outputFormat
            self.roleArn = roleArn
            self.statisticsConfigurations = statisticsConfigurations
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.excludeFilters?.forEach {
                try $0.validate(name: "\(name).excludeFilters[]")
            }
            try self.validate(self.firehoseArn, name: "firehoseArn", parent: name, max: 1024)
            try self.validate(self.firehoseArn, name: "firehoseArn", parent: name, min: 1)
            try self.includeFilters?.forEach {
                try $0.validate(name: "\(name).includeFilters[]")
            }
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1024)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.statisticsConfigurations?.forEach {
                try $0.validate(name: "\(name).statisticsConfigurations[]")
            }
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case excludeFilters = "ExcludeFilters"
            case firehoseArn = "FirehoseArn"
            case includeFilters = "IncludeFilters"
            case name = "Name"
            case outputFormat = "OutputFormat"
            case roleArn = "RoleArn"
            case statisticsConfigurations = "StatisticsConfigurations"
            case tags = "Tags"
        }
    }

    public struct PutMetricStreamOutput: AWSDecodableShape {
        /// The ARN of the metric stream.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct Range: AWSEncodableShape & AWSDecodableShape {
        /// The end time of the range to exclude. The format is yyyy-MM-dd'T'HH:mm:ss. For example,
        /// 			2019-07-01T23:59:59.
        public let endTime: Date
        /// The start time of the range to exclude. The format is yyyy-MM-dd'T'HH:mm:ss. For example,
        /// 			2019-07-01T23:59:59.
        public let startTime: Date

        public init(endTime: Date, startTime: Date) {
            self.endTime = endTime
            self.startTime = startTime
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case startTime = "StartTime"
        }
    }

    public struct SetAlarmStateInput: AWSEncodableShape {
        /// The name of the alarm.
        public let alarmName: String
        /// The reason that this alarm is set to this specific state, in text format.
        public let stateReason: String
        /// The reason that this alarm is set to this specific state, in JSON format. For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling
        /// 		alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.
        public let stateReasonData: String?
        /// The value of the state.
        public let stateValue: StateValue

        public init(alarmName: String, stateReason: String, stateReasonData: String? = nil, stateValue: StateValue) {
            self.alarmName = alarmName
            self.stateReason = stateReason
            self.stateReasonData = stateReasonData
            self.stateValue = stateValue
        }

        public func validate(name: String) throws {
            try self.validate(self.alarmName, name: "alarmName", parent: name, max: 255)
            try self.validate(self.alarmName, name: "alarmName", parent: name, min: 1)
            try self.validate(self.stateReason, name: "stateReason", parent: name, max: 1023)
            try self.validate(self.stateReasonData, name: "stateReasonData", parent: name, max: 4000)
        }

        private enum CodingKeys: String, CodingKey {
            case alarmName = "AlarmName"
            case stateReason = "StateReason"
            case stateReasonData = "StateReasonData"
            case stateValue = "StateValue"
        }
    }

    public struct SingleMetricAnomalyDetector: AWSEncodableShape & AWSDecodableShape {
        /// The metric dimensions to create the anomaly detection model for.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [Dimension]?
        /// The name of the metric to create the anomaly detection model for.
        public let metricName: String?
        /// The namespace of the metric to create the anomaly detection model for.
        public let namespace: String?
        /// The statistic to use for the metric and anomaly detection model.
        public let stat: String?

        public init(dimensions: [Dimension]? = nil, metricName: String? = nil, namespace: String? = nil, stat: String? = nil) {
            self.dimensions = dimensions
            self.metricName = metricName
            self.namespace = namespace
            self.stat = stat
        }

        public func validate(name: String) throws {
            try self.dimensions?.forEach {
                try $0.validate(name: "\(name).dimensions[]")
            }
            try self.validate(self.dimensions, name: "dimensions", parent: name, max: 30)
            try self.validate(self.metricName, name: "metricName", parent: name, max: 255)
            try self.validate(self.metricName, name: "metricName", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, max: 255)
            try self.validate(self.namespace, name: "namespace", parent: name, min: 1)
            try self.validate(self.namespace, name: "namespace", parent: name, pattern: "^[^:]")
            try self.validate(self.stat, name: "stat", parent: name, max: 50)
            try self.validate(self.stat, name: "stat", parent: name, pattern: "^(SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm)(\\d{1,2}(\\.\\d{0,10})?|100)|[ou]\\d+(\\.\\d*)?)(_E|_L|_H)?|(TM|TC|TS|WM)\\(((((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%)?:((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%|((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%:(((\\d{1,2})(\\.\\d{0,10})?|100(\\.0{0,10})?)%)?)\\)|(TM|TC|TS|WM|PR)\\(((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)):((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))?|((\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))?:(\\d+(\\.\\d{0,10})?|(\\d+(\\.\\d{0,10})?[Ee][+-]?\\d+)))\\)$")
        }

        private enum CodingKeys: String, CodingKey {
            case dimensions = "Dimensions"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case stat = "Stat"
        }
    }

    public struct StartMetricStreamsInput: AWSEncodableShape {
        /// The array of the names of metric streams to start streaming. This is an "all or nothing" operation. If you do not have
        /// 		permission to access all of the metric streams that you list here, then none of the streams that you list
        /// 		in the operation will start streaming.
        @CustomCoding<StandardArrayCoder>
        public var names: [String]

        public init(names: [String]) {
            self.names = names
        }

        public func validate(name: String) throws {
            try self.names.forEach {
                try validate($0, name: "names[]", parent: name, max: 255)
                try validate($0, name: "names[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case names = "Names"
        }
    }

    public struct StartMetricStreamsOutput: AWSDecodableShape {
        public init() {}
    }

    public struct StatisticSet: AWSEncodableShape {
        /// The maximum value of the sample set.
        public let maximum: Double
        /// The minimum value of the sample set.
        public let minimum: Double
        /// The number of samples used for the statistic set.
        public let sampleCount: Double
        /// The sum of values for the sample set.
        public let sum: Double

        public init(maximum: Double, minimum: Double, sampleCount: Double, sum: Double) {
            self.maximum = maximum
            self.minimum = minimum
            self.sampleCount = sampleCount
            self.sum = sum
        }

        private enum CodingKeys: String, CodingKey {
            case maximum = "Maximum"
            case minimum = "Minimum"
            case sampleCount = "SampleCount"
            case sum = "Sum"
        }
    }

    public struct StopMetricStreamsInput: AWSEncodableShape {
        /// The array of the names of metric streams to stop streaming. This is an "all or nothing" operation. If you do not have
        /// 			permission to access all of the metric streams that you list here, then none of the streams that you list
        /// 			in the operation will stop streaming.
        @CustomCoding<StandardArrayCoder>
        public var names: [String]

        public init(names: [String]) {
            self.names = names
        }

        public func validate(name: String) throws {
            try self.names.forEach {
                try validate($0, name: "names[]", parent: name, max: 255)
                try validate($0, name: "names[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case names = "Names"
        }
    }

    public struct StopMetricStreamsOutput: AWSDecodableShape {
        public init() {}
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your
        /// 		resources.
        public let key: String
        /// The value for the specified tag key.
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceInput: AWSEncodableShape {
        /// The ARN of the CloudWatch resource that you're adding tags to. The ARN format of an alarm is
        /// 			arn:aws:cloudwatch:Region:account-id:alarm:alarm-name   The ARN format of a Contributor Insights rule is
        /// 			arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name   For more information about ARN format, see  Resource
        /// 				Types Defined by Amazon CloudWatch in the Amazon Web Services General
        /// 			Reference.
        public let resourceARN: String
        /// The list of key-value pairs to associate with the alarm.
        @CustomCoding<StandardArrayCoder>
        public var tags: [Tag]

        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1024)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceOutput: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceInput: AWSEncodableShape {
        /// The ARN of the CloudWatch resource that you're removing tags from. The ARN format of an alarm is
        /// 			arn:aws:cloudwatch:Region:account-id:alarm:alarm-name   The ARN format of a Contributor Insights rule is
        /// 			arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name   For more information about ARN format, see  Resource
        /// 				Types Defined by Amazon CloudWatch in the Amazon Web Services General
        /// 			Reference.
        public let resourceARN: String
        /// The list of tag keys to remove from the resource.
        @CustomCoding<StandardArrayCoder>
        public var tagKeys: [String]

        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1024)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceOutput: AWSDecodableShape {
        public init() {}
    }
}

// MARK: - Errors

/// Error enum for CloudWatch
public struct CloudWatchErrorType: AWSErrorType {
    enum Code: String {
        case concurrentModificationException = "ConcurrentModificationException"
        case dashboardInvalidInputError = "InvalidParameterInput"
        case dashboardNotFoundError = "DashboardNotFoundError"
        case internalServiceFault = "InternalServiceError"
        case invalidFormatFault = "InvalidFormat"
        case invalidNextToken = "InvalidNextToken"
        case invalidParameterCombinationException = "InvalidParameterCombination"
        case invalidParameterValueException = "InvalidParameterValue"
        case limitExceededException = "LimitExceededException"
        case limitExceededFault = "LimitExceeded"
        case missingRequiredParameterException = "MissingParameter"
        case resourceNotFound = "ResourceNotFound"
        case resourceNotFoundException = "ResourceNotFoundException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize CloudWatch
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// More than one process tried to modify a resource at the same time.
    public static var concurrentModificationException: Self { .init(.concurrentModificationException) }
    /// Some part of the dashboard data is invalid.
    public static var dashboardInvalidInputError: Self { .init(.dashboardInvalidInputError) }
    /// The specified dashboard does not exist.
    public static var dashboardNotFoundError: Self { .init(.dashboardNotFoundError) }
    /// Request processing has failed due to some unknown error, exception, or failure.
    public static var internalServiceFault: Self { .init(.internalServiceFault) }
    /// Data was not syntactically valid JSON.
    public static var invalidFormatFault: Self { .init(.invalidFormatFault) }
    /// The next token specified is invalid.
    public static var invalidNextToken: Self { .init(.invalidNextToken) }
    /// Parameters were used together that cannot be used together.
    public static var invalidParameterCombinationException: Self { .init(.invalidParameterCombinationException) }
    /// The value of an input parameter is bad or out-of-range.
    public static var invalidParameterValueException: Self { .init(.invalidParameterValueException) }
    /// The operation exceeded one or more limits.
    public static var limitExceededException: Self { .init(.limitExceededException) }
    /// The quota for alarms for this customer has already been reached.
    public static var limitExceededFault: Self { .init(.limitExceededFault) }
    /// An input parameter that is required is missing.
    public static var missingRequiredParameterException: Self { .init(.missingRequiredParameterException) }
    /// The named resource does not exist.
    public static var resourceNotFound: Self { .init(.resourceNotFound) }
    /// The named resource does not exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
}

extension CloudWatchErrorType: Equatable {
    public static func == (lhs: CloudWatchErrorType, rhs: CloudWatchErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension CloudWatchErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
